TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

React Hook to Run Code After Render

2 点作者 elijahmanor将近 5 年前

2 条评论

tzs将近 5 年前
I'm not very familiar with React. In this context, does "after render" mean after React has finished updating the browser's DOM, or does it mean after the browser has finished displaying the updated DOM to the user?
nsaints将近 5 年前
useEffect as it is runs when the component is mounted and then every time the state is updates, you can control this by passing options to useEffect, to answer your question: yes after the component has been inserted into the DOM, not necessarily after the updated dom has been displayed