Using API Google Places Details Error Allow Origin Cors React Project

I'm trying to use the Google Place API to get details of Places by their Id I'm using the service provided here

I'm developing on ReactJs

follows error image:

embedded image

I've seen around here that for these Allow Origin cases you should use Maps JavaScript API -->

However what is the best way to get a google.maps reference in a REACTJS project?



I would recommend to react-google-maps which is component based. it's community is huge. Here is the working example of places API in react-google-maps make sure you have an API key.

You need to get an API key first form here. Here are steps below for API key:

  • Create a project
  • Generate a API key
  • Enable places API and Maps Javascript API
  • Restrict your API key with these APIs