reactjs / reactjs/react.dev

useEffect documentation missing variable arryas

未關閉
#1,401 0 則留言 1 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

主要語言
JavaScript
星號
11.8k
分支
7.9k
平均合併
1 天 11 小時
30 天內合併 PR
11

描述

With colleges, we were talking about how reacts useEffect compares the input array and after diving into React code I found out that its length can't vary and didn't find the note in docs.

https://github.com/facebook/react/blob/master/packages/shared/areHookInputsEqual.js

Here's the code chunk with warning handling but it may be good to mention that in docs.

You all are awesome and I love what you are doing with React. Keep rocking 👌

Thanks also @linde12 for bouncing the ideas which led to mutual conclusion

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

研究方向

先閱讀連結的 packages/shared/areHookInputsEqual.js 程式碼,然後在 React 文件網站中找到 useEffect 文件。記錄依賴陣列的長度不能變更,並在相關的 useEffect 指南明確說明這項限制後,將工作視為完成。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
javascript, react
領域
documentation
Issue 類型
文件
難度
2/5
預估耗時
1-3 小時
活躍度
停滯
描述清晰度
基本清楚
新手友好度
48/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。