i have already given the header for axios call but i am still getting this error. i have tried a lot. the code is given below: -
class Test extends React.Component { constructor(props) { super(props); this.state = { address: '' }; } componentDidMount(){ axios({type:'get',url:'https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=Chennaiined&radius=1000&keyword=fdtbf&key=KEY'},{header:{'Access-Control-Allow-Origin': 'https://maps.googleapis.com'}}) .then(res=> alert("response"+res)) } render() { return ( <div> <span>test</span> </div> ); } } i have given * instead of https://maps.googleapis.com but still getting the same error.
Thanks in advance