Reputation: 3
I am trying out React + Redux and I came upon the problem of the most people. React is not updating (re-rendering).
I have read other posts regarding the same issue but I am still unable to solve my problem.I was able to update the state but I am unable to update the props for the component.
What am I doing wrong here?
ActionCreator -
Reducer -
Store -
App -
React -
Developer Tools -
Upvotes: 0
Views: 158
Reputation: 504
First thing I'd try to do its changing passing props from:
ErrorMessage: state.ErrorMessage
to particular props, in your case isVisible
isVisible: state.ErrorMessage.isVisible
And of course after that update the line with visibility to:
visibility {this.props.isVisible}
Its because you're passing whole object and changing only props inside of it. My guess is that React doesnt detect changes like this. Let me know if it helps!
EDIT: I googled this issue and I found that, may be useful for you: http://redux.js.org/docs/FAQ.html#react-not-rerendering
Regards, Mariusz
Upvotes: 1