![]() ![]() With these many applications its far too soon to say that Redux will be replaced by the new Context API. Provide alternative UIs while reusing most of the business logic.Provide full inspection and control capabilities to the development tooling so that product developers can build custom tools for their apps.Travel between the state history in development, and re-evaluate > the current state from the action history when the code changes, ala TDD.Maintain an undo history or implement optimistic mutations without dramatic changes to how the code is written.Pass action objects over the network to implement collaborative environments without dramatic changes to how the code is written.Serialize user actions and attach them, together with a state snapshot, to automated bug reports, so that the product developers.Pre-fill state on the server, send it to the client in HTML, and boot up from it, out of the box.Persist state to a local storage and then boot up from it, out of the box.Apart from this Redux has other libraries associated with it like redux-persist which allows you to save/store data in localStorage and rehydrate on refresh which is what the Context API still doesn't support.Īs mentioned in his blog You might not need Redux, Redux has useful applications like The latest Context API can be used for Applications where you would simply be using Redux to pass data between components, however applications which use centralised data and handle API request in Action creators using redux-thunk or redux-saga still would need Redux. Its up to Redux to actually update its implementation to adhere with the latest Context API. Redux than directly because if it changes, the burden of updating the So you should feel much safer using context via React React Redux uses context internally but it doesn’t expose this fact in Redux is much more powerful and provides a large number of features that the Context API doesn't provide, also as mentioned Replace Redux - but then you probably didn't need Redux in the firstĬontext also doesn't give you anything like the Redux DevTools, theĪbility to trace your state updates, middleware to add centralizedĪpplication logic, and other powerful capabilities that Redux If you're only using Redux to avoid passing down props, context could As Context is no longer an experimental feature and you can use Context in your application directly and it is going to be great for passing down data to deeply nested components which what it was designed for.
0 Comments
Leave a Reply. |