-
Notifications
You must be signed in to change notification settings - Fork 13
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
Error from Google when using the library #134
Comments
I have the same error here, idk how to solve it using google maps react hooks, im trying to see the original code in repo causing this error, if i found it, i will tell you |
Also have the same error too. |
I am having the same error, what should I need to do? |
A temporary fix could be to disabled strict mode - |
Also have the same error. |
I am getting this too, in a Nextjs project. The problem might be when the Map Provider is rendered. |
Try Wrapping the map container inside the GoogleMapsProvider, with the react In my case I replaced my index.ts/main.ts code with this to not include the strict mode: import ReactDOM from "react-dom/client";
import App from "./App.tsx";
ReactDOM.createRoot(document.getElementById("root")!).render(<App />); Then inside the App: const App = () => {
const [mapContainer, setMapContainer] = useState<HTMLDivElement | null>(null);
const mapRef = useCallback(
(ref: HTMLDivElement) => ref && setMapContainer(ref),
[]
);
const mapsOptions: Partial<GoogleMapsConfiguration["mapOptions"]> = {
center: { lat: 43.75, lng: 17 },
zoom: 12,
};
return (
<GoogleMapsProvider
googleMapsAPIKey={MAPS_API_KEY}
mapContainer={mapContainer}
mapOptions={mapsOptions}
>
<StrictMode>
<div ref={mapRef} />
</StrictMode>
</GoogleMapsProvider>
);
};
export default App; |
Any solution to this @yfr |
Hi , when i use this package i got error on the console
It happens to everyone, did you do something wrong?
The text was updated successfully, but these errors were encountered: