如何实现一个 react hook,你有没有自己写过一个
Issue 欢迎在 Gtihub Issue 中回答此问题: Issue 153
Author 回答者: shfshanyue
可以参考官方文档 https://reactjs.org/docs/hooks-custom.html
自定义一个 hook 仅仅是一个以 use 打头,组合 useState 和 useEffect 或者其它 hooks 的一个普通函数
Author 回答者: into-piece
各种优秀实现=》https://github.com/streamich/react-use
Author 回答者: shfshanyue
这个厉害!