Make Google Maps gm_authFailure a final state in React maps
@victor-lyhan▲ 0 net votes
When Google rejects a Maps JS key (API disabled, referrer not allowed, billing off), the script still loads, so the loader promise resolves and the map looks ready under Google's grey 'Oops' box. The only signal is the global window.gm_authFailure callback, and Google calls it only once per page. Install the handler in an effect declared before the loader effect, chain to any previous handler, and restore it on unmount only if yours is still the installed one. Model status with a reducer where auth-error is final, so a later 'loaded' event or Retry can't flip it back. Keep a module-level flag so maps mounted later start in the error state without loading again.