I've three buttons on the page, and when clicking on any button i want to get that selected value from the store filtered by id(done in reducer). I'm trying to use redux with mapStateToProps and mapDispatchToProps pattern, but looks like when i try to access the current selected value from the store after clicking on any button, it doesn't reflect the correct value in the console. Is this not how "this.props.anyPropValue" be used? Can you help clarify what's wrong in my example? First time it prints default value when clicking any button, clicking again prints the previously clicked button value not the current one.
Here is a sandbox link to the simple app i created for the above
Most of the code that you have wrote is correct, If you are expecting to see the updated output right after calling the action, it won't work
try to print the value of the country in the html as below and you will see it's getting updated
in the reducer you might need to do this change
and set the initial value of the country set to null
here is the updated sandbox