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

MobX integration best practices #577

Open
hyperknot opened this issue Apr 23, 2018 · 1 comment
Open

MobX integration best practices #577

hyperknot opened this issue Apr 23, 2018 · 1 comment

Comments

@hyperknot
Copy link

Is anyone using this library with MobX?

So far I'm having trouble how can I integrate with the [zoom] array for example. If I do

zoom={mapUIStore.zoom.toJS()}

where mapUIStore.zoom is an observable.array, it doesn't work. By this I mean that

  1. setting zoom to a new value -> works
  2. scroll zooming the map to a different value
  3. setting zoom to the same value -> doesn't work, as it's already set to the same value.

When [zoom] is used with setState is the state updated behind-the-scenes?

At this point, what do you recommend me to do? Should I just use the native zoomTo and forget about the auto-syncing [zoom] array magic?

@janbaykara
Copy link

I've been using Uber's react-map-gl to apply viewport updates reliably, and then continuing with react-mapbox-gl for its layer components: See #572

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

No branches or pull requests

2 participants