TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

React Hook to Run Code After Render

2 pointsby elijahmanoralmost 5 years ago

2 comments

tzsalmost 5 years ago
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?
nsaintsalmost 5 years ago
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