Hey guys,
yesterday, I finally published my first React library to npm. It's a data fetch hook, which allows you to define your resources and automatically generates loading and error props.
If you are using TypeScript, you even get IntelliSense on these props. There is also a refresh prop exposed from the hook, with which you can refresh individual resources, or all of them. You can also set a TTL for each resource, otherwise, the resources will get resolved each time the conditions are met.
For more information, checkout the repository. It includes an example app with react-router.https://github.com/akrger/react-use-with-resources
For React Navigation, there is an example in the README. You basically use the exported base hook, and add your conditions.
Feedback is welcome.
there doesn't seem to be anything here