react-mapbox-gl
react-mapbox-gl copied to clipboard
Markers wiggle on React 18
Reproducible by upgrading React version of website example to version 18
Before (React 17):
https://user-images.githubusercontent.com/10248395/178124854-0de1e9bc-7e79-48ee-8a57-37c2c3dd8ad3.mov
After (React 18):
https://user-images.githubusercontent.com/10248395/178124860-bec3d0be-b9fe-410c-b538-9d28a0f64982.mov
+1 to this. Thanks for the videos.
+1 to this, any one know how to fix this issue?
@agusterodin Have you fixed this prolem?
Because React 18 events are auto batching state update when the map is moving, you guys can fork this repo and put flushSync to map 'move' event in ProjectedLayer component, hope this helps you

Is there any interest in making this part of the repo here instead of having to fork and go that way?
Hi @nickpolet . I created 2 files and use the Marker component instead of forking
Note: inside ProjectLayer component which i copied from this library
So somewhere in my app import Marker from 'lib/react-mapbox-gl/Marker'
<Marker ...your props />