Simple and flexible way to reference react components
react-collector lets you to reference multiple react components along the whole tree. Using the React.createRef() or other standard method you can reference only one component, but problem occurs when you want to reference array of components, for example rendered components with map(). But this is just one scenario out of many, so check it out the full power.
See the Quick start guide for more details.
- useCollector for new React Hook API
- Reference deeply nested components using the React Context API
- Reference array of components
- Reference different kind of components to their namespaces (arrays)
- Decorator @collect to simplify and shorten code writing.
- Only one dependency (hoist-non-react-statics)
- Typescripted
Checkout the examples of usage in examples page
Checkout the api reference of detail usage information
- Fork it!
- Create your feature branch: git checkout -b my-new-feature
- Commit your changes: git commit -am 'Add some feature'
- Push to the branch: git push origin my-new-feature
- Submit a pull request
Special thanks to Vipin Kumar Rawat
If you have questions, feel free to contact
- Edvinas Pranka
- Twitter: @epranka
- Email: epranka@gmail.com
- Website: www.kodmina.lt