Open markusjwetzel opened 6 years ago
// In case of lifecycles AND render prop components, we will need a WrapperComponent.
function OuterComponent() {
return (
<Composer components={[]}>
{([resultOne, resultTwo, resultThree]) => (
<InnerComponent __results={{ resultOne, resultTwo, resultThree }} />
)}
</Composer>
);
}
Another option might be a plugin system like the webpack one:
const extensions = [
new plugins.Statics({
ComponentItem,
}),
new plugins.DefaultProps({
...
}),
new plugins.State(ToggleState),
new plugins.RenderProp(ThemeContext, DeviceMotion),
new plugins.Lifecycle((props, toggle, theme, motion, ...) => ({
componentDidMount() {
...
}
})),
new plugins.Pure(),
];