React component with optional render child function as prop

Update: I’ve posted the solution in first answer

Hello, I’m playing around with ReScript, so totally newbie here.
I have this component where the children render are (optionally) handled by the parent, via a render prop function:

https://rescript-lang.org/try?code=C4TwDgpgBAThB2ATCMAq5oF4oAoCW8wANFAGYA2A9gIbACUUmAfFAEoTUDGwAdBORAC2CYAChRAAThdenSoLCV4I0QOBRB1ANZZcAP0S1qALijUYMaiAA8FGsCaYA2gF0Se4Hk5aGzKAG9RKChrRDwANygmIOCAgCF+XgBBCyseTTAAdTxgAAsASSQIAA8cQ2BqEnwScOpyAFcIXxZA2NiAegAqAGcAdxzOXKhPbwCYtoAfWARkNAwcUmayfCLimrrGunHYqYA5JSwWUIioHRBMfwTyXkLeYEoAZWAYAgBzFeRiugBfFvYZHh2Wg4WoNJrfELtMLhaJtYLfTrtbZtEZaHB6AifTB4dygxqmIH0bbfOgAWiY-24PHMlhA3xi1ihEWi9KAA

The question is, how do I handle cases where ~tick is not provided?

Plus, is this a “matchable” type?

type renderTick = (int, float) => React.element

Thanks and apologize if the question sounds silly.

I’m auto answering here:

https://rescript-lang.org/try?code=C4TwDgpgBAThB2ATCMAq5oF4oAoB+AlkhAB4BcRwANFHgG4CGANgK4RkBmTA9g8AJRRMAPigAlCAwDGwAHQQmEALYJgAKFCQoHDkNgJkaDGoACcaXKnclYbvFVrFwKEoYBrLLjyI+DMlAYYGAYQAB4uXmBhTABtAF0aPGACKTdBESgAbzUoKFDEAjooYRzcrIAhBTkAQSCQ2VcwAHUCYAALAEliEhwfYAYaHAIaRlYIdNFssrKAZwB3Vqk2qGTUrNLpgB8oAGVrCBw4YiNICf1j9Eh8ImQSPWHaUbZ+DbLtgDk7LFF8wqgPECYTKVJhyLpyYDcHbAGBEADmQ34AF9JhILLIInwcE9xki8gB6Ap0ErTXJI15I-gAWmEaJkskCwRA5NyoUJhRK5KAA

1 Like