@kobionic/react-compose
v1.0.2
Published
A simple React component used to combine multiple components.
Downloads
3
Maintainers
Readme
React-Compose
A simple React component used to combine multiple components.
Installation
npm install @kobionic/react-compose
Why?
const App = () => {
return (
<AProvider>
<BProvider>
<CProvider>
<DProvider>
<EProvider>
<MyPage />
</AProvider>
</BProvider>
</CProvider>
</DProvider>
</EProvider>
);
};
Tired of this? Ok that can lead to nice art, but that's not really the point...
Usage
const App = () => {
return (
<Compose components={[AProvider, BProvider, CProvider, DProvider, EProvider]}>
<MyPage />
</Compose>
);
};
Passing props
const App = () => {
return (
<Compose components={[AProvider, { component: BProvider, props: bProviderProps }, CProvider, DProvider, EProvider]}>
<MyPage />
</Compose>
);
};
Authors
- Jeremie Rodriguez <[email protected]> - Main developer
License
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.