NISHIO Hirokazu[Translate]
Uncaught Error: Network Error

インターネット接続のない状況でnet::ERR_INTERNET_DISCONNECTEDが出る(これはわかる)
オフラインでも使えるようにしたいのでエラーで死なないでほしい
どうやってエラー処理するんだ??
firebase.initializeAppもfirebase.firestoreもPromiseではない
firebase.initializeAppとfirebase.firestoreをtryで囲ってもダメ
Reactの側でエラー処理すべき
>componentDidCatch and getDerivedStateFromError: There are no Hook equivalents for these methods yet, but they will be added soon.
FCでできない
class ErrorBoundaryを作って解決した
今はcomponentDidCatchで単にconsole.logしている
将来的にはSentryとかにつなぐとよい


"Engineer's way of creating knowledge" the English version of my book is now available on [Engineer's way of creating knowledge]

(C)NISHIO Hirokazu / Converted from [Scrapbox] at [Edit]