@Bal Feng
demo - 计数器
1. useState
2. useEffect
3. useContent
1. useReducer
2. useCallBack
3. useMemo
4. useRef
5. useImperativeMethods
6. useLayoutEffect
.
.
.
1. 解决 function component 无法使用 state 和 生命周期方法
2. 解决组件逻辑状态(数据处理逻辑而不是数据本身)的复用
1. 解决 function component 无法使用 state 和 生命周期方法
2. 解决组件逻辑状态(数据处理逻辑而不是数据本身)的复用
function component demo
function component demo
1. 解决 function component 无法使用 state 和 生命周期方法
2. 解决组件逻辑状态(数据处理逻辑而不是数据本身)的复用
https://zhuanlan.zhihu.com/p/49408348
如何理解这句话?
示例: https://codesandbox.io/s/qqq8832v86
HOC = Function(component)
示例: https://codesandbox.io/s/qqq8832v86
The term “render prop” refers to a technique for sharing code between React components using a prop whose value is a function.
英文:https://reactjs.org/docs/hooks-reference.html
中文:https://react.css88.com/docs/hooks-reference.html
示例:https://codesandbox.io/s/42rkk4720w
React 官方文档: https://reactjs.org/docs/hooks-intro.html
精读 React hooks: https://zhuanlan.zhihu.com/p/49408348
React 中的 Render Props: https://zhuanlan.zhihu.com/p/31267131
30分钟精通 React hooks:
https://juejin.im/post/5be3ea136fb9a049f9121014
ReHooks 社区: https://github.com/rehooks/
摒弃mixin: https://top.css88.com/archives/750