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

Use a static property to detect Backspace and Delay elements #42

Merged
merged 1 commit into from
Apr 15, 2018
Merged

Use a static property to detect Backspace and Delay elements #42

merged 1 commit into from
Apr 15, 2018

Conversation

dastoori
Copy link
Contributor

It's related to this commit

Comparing reference type of Backspace and Delay doesn't work with react-hot-loader. I use next.js and it's using react-hot-loader in the background and I have same issue as #33. cause of the problem is this:

Because React Hot Loader creates proxied versions of your components, comparing reference types of elements won't work
https://github.com/gaearon/react-hot-loader#checking-element-types

It's a known issue of react-hot-loader and it seems that it's not going to be fixed from their side: gaearon/react-hot-loader#304

The only solution that I found (for libraries) is to define a static property for each components and then compare them.

I used componentName property and it's working on both next.js and minified version.

@jstejada
Copy link
Owner

@dastoori thanks for looking into this! This solution looks good to me.

I haven't set up CI for this repo yet unfortunately :(, but would you mind confirming that the tests still pass? Otherwise, I'll test it too and merge it

Thanks!

@dastoori
Copy link
Contributor Author

dastoori commented Mar 19, 2018

All tests passed ✅

@jstejada
Copy link
Owner

Sweet, thanks @dastoori !

@jstejada jstejada merged commit 066d32f into jstejada:master Apr 15, 2018
@stevemao
Copy link

Can you make a new release? @jstejada

@jstejada
Copy link
Owner

jstejada commented Jan 2, 2019

released as 2.0.5. I'm really sorry for the delay!

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

Successfully merging this pull request may close these issues.

None yet

3 participants