Steps of Redux
1.) Create Action2.) Create Reducer
3.) Create Root Reducer ---> combine all reducer in one file
4.) Create Store
5.) Inject store to App component, wrap app with provider in app component and pass store as property
6.) use hook useSelector to directly access state---->used to display state value that are hold by redux store
7.) use hook useDispatch give directly dispatch access.
--> Send action by using dispatch method.
--> You can update state value by using useDispatch hook
Note:
2.) useDispatch and useSelector hook use in your normal component whereever you needed.
7.) use hook useDispatch give directly dispatch access.
--> Send action by using dispatch method.
--> You can update state value by using useDispatch hook
Note:
1.) MapStateToProps and mapDispatcchToProps are old redux method
2.) useDispatch and useSelector hook use in your normal component whereever you needed.
No comments:
Post a Comment