Skip to content
This repository has been archived by the owner on Aug 21, 2020. It is now read-only.

React.PureComponent doesn't work with HMR #133

Open
Restuta opened this issue Nov 2, 2016 · 2 comments
Open

React.PureComponent doesn't work with HMR #133

Restuta opened this issue Nov 2, 2016 · 2 comments

Comments

@Restuta
Copy link

Restuta commented Nov 2, 2016

I upgraded my existing React project to use official React.PureComponent and hot reloading stopped working. I know it's "no maintenance intended", so I will be happy to submit a fix, but I need a simple pointer from you @gaearon. I think the fix would be good until RHL 3 lands. I am surprised nobody raised this issue so far, nobody upgrades to official React.PureComponent?

I digged into code a little and see that proxyReactComponents doesn't get components that derive from React.PureComponent, not sure why. Can you please point me to right direction?

@Restuta
Copy link
Author

Restuta commented Nov 2, 2016

Also if I just rename my import like this:

import React, { PureComponent as Component} from 'react'

it works, looks like somewhere Component is hardcoded, should be an easy fix.

@RichardLindhout
Copy link

@Restuta Smart ;), You made my day!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants