Skip to content
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

Closed
steida opened this issue Aug 2, 2016 · 11 comments
Closed

PureComponent doesn't work with hot reloading #9152

steida opened this issue Aug 2, 2016 · 11 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@steida
Copy link

steida commented Aug 2, 2016

No iOS nor Android.

@steida steida changed the title PureComponent doesn't work with Android Hot Reloading PureComponent doesn't work with Android hot reloading Aug 2, 2016
@hijamoya
Copy link

hijamoya commented Aug 2, 2016

Can you provide code? thanks!

@steida steida changed the title PureComponent doesn't work with Android hot reloading PureComponent doesn't work with hot reloading Aug 2, 2016
steida added a commit to este/este that referenced this issue Aug 2, 2016
- 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
@steida
Copy link
Author

steida commented Aug 6, 2016

Just create RN 30 or 31 app with React 15.3, and use PureComponent instead of Component. Hot reloading will not work.

@max-mykhailenko
Copy link

Hot reloading also doesn't work with function components.

@steida
Copy link
Author

steida commented Sep 3, 2016

Hmm, maybe we can fix it just with rerendering whole app. But how?

@patrickgordon
Copy link

👍

Same issue here with:
RN @ 0.32.0
React @ 15.3.2

@steida
Copy link
Author

steida commented Nov 9, 2016

This is enough for hot reloading in React Native https://github.com/este/este/blob/master/src/native/app/Root.js#L13

@dylanpyle
Copy link

Still seeing this in react-native 0.42.0. @steida did you find a solution?

@steida
Copy link
Author

steida commented Mar 15, 2017

@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

@johnculviner
Copy link

@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

"react-native": "^0.47.1",

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 🍻

@rafeca
Copy link
Contributor

rafeca commented Oct 20, 2017

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 😄

@tafelito
Copy link

tafelito commented Apr 9, 2018

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.
Should I open a new issue for this?

@facebook facebook locked as resolved and limited conversation to collaborators May 24, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

9 participants