hooks icon indicating copy to clipboard operation
hooks copied to clipboard

resetState的随机数问题

Open coding-ice opened this issue 1 year ago • 2 comments

@liuyib ,麻烦看可行不,暂时只发现三个

hooks

  • useMap
  • useSet
  • useCounter

before

{
  reset: useMemoizedFn(reset)
}

after

const reset = useCallback(() => {
  setState(initialValue)
}, [])

coding-ice avatar May 15 '24 09:05 coding-ice

这个是要解决什么问题呢?

crazylxr avatar Jul 16 '24 01:07 crazylxr

这个是要解决什么问题呢?

重置state后,随机数会变化

coding-ice avatar Jul 16 '24 02:07 coding-ice