ErrorPro / react-google-autocomplete

React components for google places API.
MIT License
473 stars 114 forks source link

Handling error when api key is wrong #163

Closed am2222 closed 2 years ago

am2222 commented 2 years ago

Hi, When Api key is wrong I get an error that breaks my app. Is there any way to handel this error silently? I used an error boundary around the component but it still breaks my code.

ErrorPro commented 2 years ago

@am2222 Hi! The best way is to not render the input if apiKey is not provided. {apiKey ? <Autocompletet ... /> : null} let me know if this doesn't work for you

adamwong246 commented 1 month ago

this doesn't really work for me

am2222 commented 1 month ago

@adamwong246 I think a cleaner way is to develop an error boundary for this