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.

Image not update when state changed

See original GitHub issue

<SimpleImg height={300} src={this.state.uploadedUrl} />

when this.state.uploadedUrl change image not updated.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
stpwincommented, Apr 7, 2019

Thank you!

1reaction
bluebill1049commented, Apr 7, 2019

how about this approach:

https://codesandbox.io/s/6z3lx27p5z

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why is the state not updating when post method is done?
The problem I'm facing with this code is that when I start the server and select the image and type the text and...
Read more >
Image Component will not update correctly when passing ...
So I have this basic network image component. It will probably look similar to the one in the Image Component documents.
Read more >
Updating Objects in State
State can hold any kind of JavaScript value, including objects. But you shouldn't change objects that you hold in the React state directly....
Read more >
React Native Hooks Not Updating Component when State ...
When I listened within the useEffect() for the form change, I could see that my setItem function was getting called, and the state...
Read more >
How not to update states in React!!
As you mentioned, the state updates are scheduled, not ran in place, so the value of the state will not be changed until...
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