8000 GitHub - ZWLTZ/react-hooks-notes: About react hooks notes
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

ZWLTZ/react-hooks-notes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
< 9855 svg aria-hidden="true" focusable="false" class="octicon octicon-file-directory-fill icon-directory" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom">
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

React Hooks就是用函数的形式代替原来的继承类的形式,并且使用预函数的形式管理state,有Hooks可以不再使用类的形式定义组件了。

    1. useState:声明状态变量,可读取,更改
    1. useEffect:替代常用生命周期函数
    1. useContext:可以让父子组件传值更简单
    1. useReducer:类式redux一样管理state
    1. useMemo:减少不必要的渲染,提高性能。类式class component内shouldComponentUpdate
    1. useRef: 获取jsx中Dom元素
    1. 如何自定义一个react-hooks函数

About

About react hooks notes

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0