React Hooks 常用钩子
React HooksuseStateconst [count, setCount] = useState(0);// 等价于const _useState = useState(0);const count = _useState[0];const setCount = _useState[1];useEffect// 异步,处理副作用(即不是主逻辑,比如生命周期,接口请求等)useEffect(() => { console.log('不传参相当于componentDi
原创
2021-11-02 14:23:51 ·
349 阅读 ·
0 评论