Skip to content

erikras/react-adopt

 
 

Repository files navigation

😎 React Adop - Compose render props components like a pro

GitHub release Build Status Codacy Badge

🧐   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:

Bad

💡   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:

Good

🕺   Contribute

  1. Fork this repository to your own GitHub account and then clone it to your local device
  2. Install dependencies using Yarn: yarn install
  3. Make the necessary changes and ensure that the tests are passing using yarn test
  4. Send a pull request 🙌

About

😎 Compose render props components like a pro

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 100.0%