-
Notifications
You must be signed in to change notification settings - Fork 24.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PureComponent doesn't work with hot reloading #9152
Comments
Can you provide code? thanks! |
- Use React.Component until facebook/react-native#9152 - remove not important message - refactor common/app/theme - fix sidemenu bg color - Leverage iOS / Android status bar height
Just create RN 30 or 31 app with React 15.3, and use PureComponent instead of Component. Hot reloading will not work. |
Hot reloading also doesn't work with function components. |
Hmm, maybe we can fix it just with rerendering whole app. But how? |
👍 Same issue here with: |
This is enough for hot reloading in React Native https://github.com/este/este/blob/master/src/native/app/Root.js#L13 |
Still seeing this in react-native 0.42.0. @steida did you find a solution? |
@dylanpyle I don't use PureComponent anymore. It's a workaround to issue which is better to avoid. shouldUpdate belongs to data, not to a component because it slow downs PureComponent first render. redux-connect does it on data change, which is better. So, don't use PureComponent. Check Este https://github.com/este/este |
@orta This still appears to be an issue (for me at least). HMR doesn't work unless I switch stuff to Component instead of PureComponent for
I understand @steida says don't do it but that appears to be in the specific context of you using redux/connect which understandably isn't everyone's scenario (especially not for every component in an entire application) Should this issue remain open or what am I missing about how it was fixed to be closed? Thank you for any insight you can provide 🍻 |
Sorry for the delay with this issue, this had been fixed in gaearon/babel-plugin-react-transform#106 and the fix will go to RN v0.50 😄 |
I know this is an old issue but I'm having this issue using FlatList. I have a class component that renders a List with a ListHeaderComponent. If I change anything on the component, the list is not being updated. |
No iOS nor Android.
The text was updated successfully, but these errors were encountered: