question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

When props are updated the UI doesn't reflect the update

See original GitHub issue

If 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:closed
  • Created 8 years ago
  • Comments:18 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
tuononhcommented, Sep 20, 2018

so update messages using setState() won’t work as well? How can I delete a message? I tried setState() to modify messages array but it didn’t work.

1reaction
kfiroocommented, Jan 26, 2017

@b8ne Your selector should always return a new array when something changes.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found