Closed nerijusgood closed 3 years ago
Hi @nerijusgood, make sure that your non-primitive prop values are memoized. Please provide a Code Sandbox if you need help figuring out how to do this. Here's an example https://codesandbox.io/s/react-map-gl-geocoder-using-containerref-to-ignore-events-rewdh.
Hi @SamSamskies, I'm having a similar issue when rendering multiple geocoders:
I have attempted to memoize my non-primitive prop values and this has not changed the result, however this is the first time that I have memoized in React so not sure if done correctly.
I have recreated these issues in Code Sandbox - https://codesandbox.io/s/multiple-react-gl-geocoders-clkps?file=/src/App.js (I've removed my mapbox token in App).
Thanks for this great project!
Hi @fletcherdemeo, your onResult
prop is not memoized.
Thanks @SamSamskies, much appreciated? Any idea why the first child that renders initially does not leave a marker?
@fletcherdemeo my guess would be that it has something to do with onResult
not being memoized.
If necessary i can try re-create issue.