You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Based on discussion with @wokalski , this seems doable with a PPX
Constraints between parent <-> children - Another useful case would be to express that only certain components can be children of a specific parent. An example might be a FlexLayout widget, that can only take Row, Column as first-level children. Other examples could be a <Menu> that only allows <MenuItem /> as children, etc. Fixed in Defunctorize Brisk_reconciler #46.
I think this may be something that could be supported via nested reconcilers - @wokalski mentioned that perhaps we could model this as a type constraint where element('a) is generic, element(menuComponent) is specific to a menu, etc.
The text was updated successfully, but these errors were encountered:
@bryphe Single child components can only work sensibly with full blown static react. If you use any other approximation it still produces invalid states. i.e.
(Related to the nesting-reconcilers discussion in #30, and the compositional component discussion in revery: revery-ui/revery#489) Also inspired by @jordwalke 's exploration on statically typed React trees: https://github.com/reasonml/reason-react/tree/StaticReactExperiment/explorations
There have been cases that have come up where it'd be nice to make some constraints on the tree at compile-time:
<Transform />
Based on discussion with @wokalski , this seems doable with a PPX
Constraints between parent <-> children - Another useful case would be to express that only certain components can be children of a specific parent. An example might be aFixed in Defunctorize Brisk_reconciler #46.FlexLayout
widget, that can only takeRow
,Column
as first-level children. Other examples could be a<Menu>
that only allows<MenuItem />
as children, etc.I think this may be something that could be supported via nested reconcilers - @wokalski mentioned that perhaps we could model this as a type constraint where
element('a)
is generic,element(menuComponent)
is specific to a menu, etc.The text was updated successfully, but these errors were encountered: