English

​​React​lazy,startTransition,Suspense,TypeScript,トラブルシュート

Thumbnail of post image 090

React 18 でボタンを押してタブやモーダルの中身を lazy で出したとき、「A component suspended while responding to synchronous input」で画面が真っ白になる場合は、S ...

​​React​Error Boundary,esbuild,startTransition,Suspense,TypeScript

Thumbnail of post image 027

​

lazyで包んだコンポーネントは、初めて表示するまでコードを読み込みません。コード分割で、アプリの最初の読み込みを軽くしたいときに使えます。読み込み中の表示の出し方、default以外のexportの読み込み方、先に読み込みを始める方 ...

​​React​startTransition,TypeScript,useEffect,useSyncExternalStore,サーバーレンダリング

Thumbnail of post image 030

​

React の外にあるストアを useSyncExternalStore で読むと、Transition の描画中にストアが変わっても、画面の値がそろいます。useEffect で購読する書き方と比べ、3つの引数の落とし穴も確かめまし ...