When props are updated the UI doesn't reflect the update
See original GitHub issueIf you have this.props.messages
and messages gets updated after an action is triggered the ui doesn’t reflect the changes but render is called again on the component with the new set of props.
Is their something i’m missing for receiving new props or is this a 🐛
Issue Analytics
- State:
- Created 8 years ago
- Comments:18 (4 by maintainers)
Top Results From Across the Web
React: why child component doesn't update when prop changes
Update the child to have the attribute 'key' equal to the name. The component will re-render every time the key changes.
Read more >Why React doesn't update state immediately - LogRocket Blog
When developing React applications, you may have noticed that state updates don't immediately reflect new values after being changed.
Read more >Why React Child Components Don't Update on Prop Changes
In particular, a common problems is to wonder why a child component doesn't update when its prop changes. In React, it's a common...
Read more >Why isn't my React component updating (using Redux)?
And still the component is not updating. Your useSelector is subscribing to the value in the store, but its value is not updated...
Read more >Updating Objects in State - React Docs
So React does not do anything in response. It's like trying to change the order after you've already eaten the meal. While mutating...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
so update
messages
usingsetState()
won’t work as well? How can I delete a message? I triedsetState()
to modifymessages
array but it didn’t work.@b8ne Your
selector
should always return a new array when something changes.