-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
architecturePrepare for warp speedPrepare for warp speed
Description
Box currently doesn't support additional properties defined by Flex. We need to figure out a scalable component architecture that supports component hierarchies.
Approach 1
Boxis a base component providing all core props for a component setFlex,Block, etc are specific variations ofBoxto reduce prop fatigue- Proven approach that scales reasonably well
<Flex /> === <Box d="flex" />
<Flex direction="column" /> === <Box d="flex" direction="column" />
Approach 2
Boxis a "render" component that identifies which type of component to renderBoxremoves only the props it needs before passing the rest toFlex- e.g.
Boxis responsible for background color, notFlex
- e.g.
- Unexplored api, unclear implications regarding performance, benefits, detriments, etc
const Box = ({d, ...restProps}) => {
if (d === 'flex') {
return <Flex {...restProps} />
}
}
Others?
- Does
Boxneed to support allFlex,Blockproperties or can it be a "style" component? 🤔Boxhandles box shadow, border, background color, margin, padding, etcFlex,Block, etc handles display, justify content, etc
Metadata
Metadata
Assignees
Labels
architecturePrepare for warp speedPrepare for warp speed