何回目のレンダリングか調べる

 const renderCount = useRef(0);
 
 useEffect(() => {
   renderCount.current += 1;
   console.log(`${renderCount.current} ren ` + new Date().toISOString());
 });
  • refを使う

トップ   編集 凍結 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS

Last-modified: 2023-09-09 (土) 15:37:35