Open khaledosman opened 5 years ago
The issue seems to be due to React.StrictMode #921 , I still don't understand why react's strictMode would break this
@khaledosman try new updated version of this lib: @react-google-maps/api. We had been sured that it has no issues in StrictMode https://github.com/JustFly1984/react-google-maps-api/tree/master/packages/react-google-maps-api
I'm using the <DirectionsRenderer>
component which doesn't seem to be supported in the updated version or in the docs here https://react-google-maps-api-docs.netlify.com/src-shapes .. Also the API is quite different I don't really want to rewrite the implementation.
@khaledosman My initial need was <DirectionsRenderer />
component for the project I'm working on: www.drivefromto.com
There is an example for directions renderer in https://react-google-maps-api-gatsby-demo.netlify.com/
You can copy the code from here: https://github.com/JustFly1984/react-google-maps-api/blob/master/packages/react-google-maps-api-gatsby-example/src/examples/directions-renderer-example.js
@khaledosman also you can run gatsby.js example and play with it.
The marker location doesn't update with state correctly the first time its changed, instead a third marker is created even though there're only two in state, if I do another setTimeout to update it, it updates the newly created one correctly. It seems like the library is caching & not removing the old markers on initial render or something similar.
Steps to reproduce