You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 9, 2020. It is now read-only.
@satya164 Mostly out of a desire for consistency. Declaring functions within a component as bound class properties simplifies "this" scoping, and declaring all class methods the same way seemed sensible (http://babeljs.io/blog/2015/06/07/react-on-es6-plus/#arrow-functions). That said, it's clear there's a cost to doing it that way, and it doesn't work for all component method. Live and learn!
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
In the context of a class
With this, hot reloading works:
But with this, no hot reloading happens in the component or any of its child components:
Based on #51, I'd expect that making a change to componentDidMount would not trigger a hot reload when declared as a class property.
What surprises me is that making a change to the render method in the component—which is not a class property—fails to trigger a hot reload.
I'm able to consistently reproduce the problem with this test component:
While this component hot reloads as expected:
Maybe a bug with my setup, or maybe a bug with react-transform-HMR. If it's the former, sorry to waste your time—if the latter, perhaps this helps.
(Thanks so much for your work on this and related components. My team and I have truly enjoyed working with Redux, etc.)
The text was updated successfully, but these errors were encountered: