-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Open
Labels
project:react-native-webIssue associated with react-native-webIssue associated with react-native-web
Milestone
Description
The problem
The Image component reloads on each rerender.
How to reproduce
https://codesandbox.io/s/happy-mountain-i2eol?file=/src/App.js
Steps to reproduce:
- Add the Image tag to your component
- Add the onLoad property to the Image tag
- set state in the onLoad property
Expected behavior
It would work similar to the img tag. Here is the same code sandbox with <Image swapped out for <img src= https://codesandbox.io/s/happy-bell-i4v5q?file=/src/App.js
Environment (include versions). Did this work in previous versions?
Please see code sandbox. It did not work differently in a previous verion that I am aware of.
Disclaimer: My expectations and use case might not align with react native web. However I am not sure how to successfully set state in onLoad without a duplicate render.
Metadata
Metadata
Assignees
Labels
project:react-native-webIssue associated with react-native-webIssue associated with react-native-web