pedronauck / react-adopt
- воскресенье, 1 апреля 2018 г. в 00:16:11
TypeScript
😎 Compose render props components like a pro
Render Props are the new hype of React's ecossystem, that's a fact. So, when you need to use more than one render props component together, this can be borring and generate something called a *"render props callback hell", like that:
React Adopt it's just a simple method that you can compose your components and return all props in a function by mapping each child prop returned by your component.
Install as project dependency:
$ yarn add react-adopt
Now you can use adopt to compose your components. See above an example using the awesome react-powerplug: