Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

react hooks的一些思考 #95

Open
ZhengXingchi opened this issue Jul 6, 2020 · 4 comments
Open

react hooks的一些思考 #95

ZhengXingchi opened this issue Jul 6, 2020 · 4 comments

Comments

@ZhengXingchi
Copy link
Owner

ZhengXingchi commented Jul 6, 2020

参考文献

阿里出了一套hooks仓库从 Umi Hooks 到 ahooks

Hooks FAQ支持切换为中文

@ZhengXingchi
Copy link
Owner Author

ZhengXingchi commented Jul 6, 2020

监听dom大小变化

ResizeObserver:是一项新的功能,监听元素的内容矩形大小的变更,并通知做出相应的反应。和document.onresize的功能很相似。

参考ResizeObserver是什么?

ResizeObserver MDN

@ZhengXingchi
Copy link
Owner Author

ZhengXingchi commented Jul 7, 2020

@ZhengXingchi
Copy link
Owner Author

useEffect

react hook 中useEffect返回的函数是在什么时候执行?
执行当前effect之前对上一个effect进行清除
官网有详细说明的传送门

@ZhengXingchi
Copy link
Owner Author

useLayoutEffect

参考useEffect与useLayoutEffect

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant