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

FeatureState doesn't play nicely with hot reloading #317

Open
livtanong opened this issue Mar 4, 2021 · 0 comments
Open

FeatureState doesn't play nicely with hot reloading #317

livtanong opened this issue Mar 4, 2021 · 0 comments

Comments

@livtanong
Copy link

livtanong commented Mar 4, 2021

Describe the bug
When I hot reload I get the following error message:
Error: The source '{{source-id}}' does not exist in the map's style.
I'm guessing this is because no cleanup for feature states happens during unmounting of the Source component

To Reproduce
Just use feature state, then trigger a hot reload

Expected behavior
No error

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser: Microsoft Edge (Chromium)
  • Version: 88.0.705.81

Additional context
I'm aware the solution cannot be the same as with Layer cleanup shown here, but I think it's possible to use queryRenderedFeatures in conjunction with removeFeatureState.

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