question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

componentWasMounted/componentWasUpdated (formerly componentDidDisplay)

See original GitHub issue

Proposal: New life-cycle that fires after componentDidMount and after the event-loop has returned but before any other reconciliation has started.

Effectively, this give you a componentDidMount that doesn’t block the visual output. It could be a good place to set up timers, subscriptions etc.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:2
  • Comments:23 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
gaearoncommented, Mar 24, 2021

This is basically what useEffect is.

1reaction
bloodyowlcommented, Sep 8, 2016

A componentDidRender lifecycle method would be interesting, for browser|native|* specific patches 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

React.Component
An update can be caused by changes to props or state. These methods are called in the following order when a component is...
Read more >
javascript - React Warning: Can only update a mounted or ...
Warning: Can only update a mounted or mounting component. This usually means you called setState, replaceState, or forceUpdate on an unmounted ...
Read more >
Fetching Data and Updating State in a React Class | Pluralsight
The componentDidMount method is a great place to request data from the server since even though setting the state will cause a second...
Read more >
React lifecycle methods: An approachable tutorial with examples
Learn all about React lifecycle methods for mounting, updating, unmounting, and error handling, including new methods as of React 17.
Read more >
React 16 Lifecycle Methods: How and When to Use Them
A revised and up-to-date guide to the new React component lifecycle ... into four sections: mounting, updating, unmounting, and errors.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found