This content originally appeared on DEV Community and was authored by Lupita Rivera
How to connect React with Redux - if you a newbie like me you might feel like i don't even know where to start. well my friend i got you covered.
React + Redux are widely used and popular technologies for developing the the front-end of the web project. we are also will be talking about Thunk middleware and what does for us.
but first lets check out and see what Redux is.
Redux is here to solve problems, passing the above photo you see on the left side will be react without Redux which means on the object tree where ever you set up state you can only pass down to child's components or to parent component but never to side to side. you might be thinking thats lot of code to write 👩‍💻 right ? well on the right side of that same photo will be using Redux.
Redux is a tiny state management library.
It’s meant to make your state management more predictable, and centralize your React state data, and state logic.
Redux solves these problems
1: Single source of truth
Your entire app state data is in one object tree.
This tree may also be known as a store.
By maintaining a single store it allows you to be debug or inspect your application much easier.
2: State is read-only
Your store data gets passed down as React props. Which React doesn’t allow you to modify the props object directly.
Redux only allows you to update your store data through a functions called dispatch which you must defined the action to trigger.
... to be continued
This content originally appeared on DEV Community and was authored by Lupita Rivera
Lupita Rivera | Sciencx (2021-10-09T23:31:09+00:00) connect React with Redux. Retrieved from https://www.scien.cx/2021/10/09/connect-react-with-redux/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.