Open isaacfink opened 4 months ago
use with useCallback
and add placesService
as deps. issue will be fixed.
const getPlaceInfo = useCallback(async (placeId) => {
console.log(placesService);
const info = await placesService.getDetails({ placeId });
}, [placesService]
I resolved this by passing a callback as the second parameter.
placesService.getDetails({ placeId }, (response: any) => {
console.log("response", response);
});
I am creating my instance like this
And calling the
placesService
like thisBut in the console I see this
{Fg: F$}
andgetDetails
is undefined, I am not sure where this is coming from, it might have something to do with the bundler but it seems like the returned object is wrong