关于 useSetState 返回值中的第二个参数没有用 useMemoriedFn 包裹产生的问题
Open
pr welcomed
- Dominant language
- TypeScript
- Stars
- 15k
- Forks
- 2.8k
- Avg merge
- 15h 7m
- Merged PRs (30d)
- 2
Description
如图,在 useMemo / useEffect / useCallback 中使用 useSetState 的时候,eslint 会提示需要把 setState 作为依赖。
查阅源码发现这块的返回值并没有用 useMemoriedFn 包裹。希望能在新版本改善
Contributor guide
Research direction
Start by reading the useSetState implementation and inspect how its returned second function is created. Check the existing tests for useSetState and add coverage for using that function in useMemo, useEffect, or useCallback without an unnecessary dependency warning. Done means the returned function has stable memoized behavior and the relevant tests pass.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100