GitHub - pedronauck/react-adopt: Compose render props components like a pro
source link: https://github.com/pedronauck/react-adopt
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
README.md
?React Adop - Compose render props components like a pro
? Why
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:
? Solution
- Small. 0.7kb minified!
- Extremelly Simple. Just a method!
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.
? Usage (demo)
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:
? Contribute
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK