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

error if not all instances initially mounted #11

Closed
SassNinja opened this issue Apr 1, 2020 · 1 comment
Closed

error if not all instances initially mounted #11

SassNinja opened this issue Apr 1, 2020 · 1 comment
Labels

Comments

@SassNinja
Copy link

I'm using hot-reload in combination with webpack-loader

I've placed the same component multiple times on my page but I'm only mounting one of them (dependent on viewport)
When I make changes to the component's file I expect only the mounted component to be updated.

However it seems hot-reload tries to (re)mount all tags of that component on the page what causes the following error:

TypeError: Cannot read property 'unmount' of undefined

Some debugging showed me that oldTag is undefined when it's getting reloaded without being mounted before.
Therefore I'd suggest to simply check if oldTag isn't undefined before trying to unmount it
https://github.com/riot/hot-reload/blob/master/src/index.js#L19

@GianlucaGuarini what do you think?

@GianlucaGuarini
Copy link
Member

Thank you for this bug. I will have a look at it. It should be trivial to solve it

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

No branches or pull requests

2 participants