Description
I have a next.js app where I am rendering a fullscreen map with a GeolocateControl. The first time I load the page, or if I reload it, it shows two GeolocateControls one on top of the other.

The control works as expected, but no matter which one you click the bottom control highlights.

If I navigate away from the page to another route in my app (I am using next.js routing) when I return to the map it only shows one control.
Expected Behavior
It should show only one Geolocate control.
Steps to Reproduce
import Map, { GeolocateControl } from 'react-map-gl'
<Map
initialViewState={{
longitude: long,
latitude: lat,
zoom: 15
}}
id='spot-map'
ref={map}
className='h-full w-full'
attributionControl={false}
mapStyle='mapbox://styles/mapbox/streets-v11'
mapboxAccessToken={mapboxgl.accessToken}
>
{position && <Marker color='bg-info' latitude={lat} longitude={long} anchor='top' />}
<GeolocateControl
trackUserLocation
showUserLocation
style={{ position: 'absolute', zIndex: '50', top: 80, right: 6 }}
/>
</Map>
- Load the page
- Notice two controls
- Navigate to another route
- Navigate back
- Notice that there is now only 1 control
Environment
- Framework version: react-map-gl@7.0.10
- Map library: mapbox-gl@2.7.0
- Browser: Firefox
- OS: MacOS 12.2.1
Logs
WebGL warning: texImage: Alpha-premult and y-flip are deprecated for non-DOM-Element uploads. 2
WebGL warning: texImage: Alpha-premult and y-flip are deprecated for non-DOM-Element uploads. 21
WebGL warning: texImage: Alpha-premult and y-flip are deprecated for non-DOM-Element uploads. 4
WebGL warning: texImage: Alpha-premult and y-flip are deprecated for non-DOM-Element uploads. 4
After reporting 32, no further warnings will be reported for this WebGL context. ```
Description
I have a next.js app where I am rendering a fullscreen map with a GeolocateControl. The first time I load the page, or if I reload it, it shows two GeolocateControls one on top of the other.
The control works as expected, but no matter which one you click the bottom control highlights.
If I navigate away from the page to another route in my app (I am using next.js routing) when I return to the map it only shows one control.
Expected Behavior
It should show only one Geolocate control.
Steps to Reproduce
Environment
Logs