useSelector() in Redux not rendering new value ❓
I am learning redux , so made a demo webApp and in that I am incrementing and decrementing the value by 1 on button click .
The problem is useSelector() hook in redux get fired once when the component is mounted but after that it doesn't re-render the changed value ..
Here is the code :->
Reducer :
and the main File :
4 Replies
Please help me out , I am tired of trying different methods from last 2 days ,
I am using old version of redux in reactjs ( "react-redux": "^7.2.6" , "redux": "^4.1.2" )
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
@acemouty Thanks buddy for stepping in . 🙏
This is my repo link it's just a very small test project ,
In this I am trying to increment and decrement the value by 1 in test1 file and see the result in input tag which takes the value from redux ,
please ignore test2 file its of no use ( I forgot to delete it ) ,
The branch is : Redux-Basics
https://github.com/agroot2002/React-State-Management/tree/Redux-Basics
I will be very happy if you have a look and help me out ...
Thank You 😊
GitHub
GitHub - agroot2002/React-State-Management at Redux-Basics
In this repo you will get various methods of sharing value among the different components in reactjs ..... - GitHub - agroot2002/React-State-Management at Redux-Basics
And I am not using Redux Toolkit I am using the before version of Redux for tutorial and practice purpose 👍