• 2024-07-13React中使用usePrevious的意义是什么,为啥要用它
    usePrevious钩子exportfunctionusePrevious<T>(value:T):T|undefined{constref=useRef<T>();useEffect(()=>{ref.current=value;},[value]);returnref.current;}注:更多好用的性能钩子网站推荐:https://react-hooks-library.vercel.ap