What is the current recommendation or best practice for dealing with global application state in a Relay app? I have some state is strictly client-side (e.g. is the navigation panel open or closed) that I need to manage, as well as some RESTful data that isn't available through GraphQL.
I know that Relay 2 may solve this, but waiting "some time between Date.now() and Date.now() + Infinity" isn't an option ;)
Relay combines your React components with that's needed specifically for that component and renders it optimally to your frontend app. Now, the cache works by associating each piece of data with a unique ID.
When you have state management in place data actually flows from your app to state and vice versa. You know exactly where your data is. These state management tools also give you a point-in-time snapshot of the entire data. In that way, you know exactly where your data is and that makes your development faster.
Relay is a framework for managing and declaratively fetching GraphQL data. It allows developers to declare what data each component needs via GraphQL, and then aggregate these dependencies and efficiently fetch the data in fewer round trips.
What is React State Management? React components have a built-in state object. The state is encapsulated data where you store assets that are persistent between component renderings. The state is just a fancy term for a JavaScript data structure.
Add Redux ! The two of them colocates very easily, and this is what is done in the f8app.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With