I have an react component and inside it I have state called "user" with some data, I need this state in other component . please how do this with redux ?
1 Answer
If user is part of the component's local state, and the other component is not nested inside it, then you need to move that piece of information out of local state and into Redux's store state.
4 Comments
chautelly
If the other component is nested inside the component with
user in local state, then you can pass it down as a prop.John
It is not nested inside, I must use redux but I don't know how , please can you explain with an sample example ?
chautelly
Have you gone through the documentation available at redux.js.org/docs/introduction
John
Yes I did this but I don't arrive to do any small example .