React + Redux
Why we use redux in react?
* Redux is an open-source Javascript library for managing
application state and building user Interfaces.
* You can write Redux apps with React ,Angular,Ember,JQuery
or vanilla Javascript.
* If you have few components in your application, with the
help of props ,we can pass these variables from parent component to various
other components(Child Components).
* But as the number of components increases in the
application,if we need to pass these props to other components located far away
for each other in the component tree.
* At this moment, the usual way of transferring state as props to be complex.
Store
|
Main Page |
Welcome Page |
Thank you Page |
|
Sign Up |
Greeting content |
Purchasing details |
|
Sign In |
Products for sales |
Again Greeting content |
Redux (Action , Reducers, Store,
View)
Action:
* Actions have a type of fields that tells what kind of
action to perform.
* It includes information such as type of action,time of
occurrence ,location of occurrence ,its coordinates , and which state it aims
to change.
Reducers:
* Actions only tell what to do, but they don’t tell how to
do, so reducers are the functions that take the current state and action and
return the new state and tell the store how to do.
Store:
* The store contains state of the components which need to
be passed to other components.
View:
* The view will receive data from the store and re-render
the app.
No comments:
Post a Comment