Answer the question
In order to leave comments, you need to log in
React. How to track render?
It is necessary to perform a series of actions exactly after the component has rendered for the first time, how to do this.
I thought in the direction of componentDidMount, but it is called before render.
componentDidUpdate - Called after subsequent render calls, but not the first.
Answer the question
In order to leave comments, you need to log in
componentDidMount() is invoked immediately after a component is mounted. Initialization that requires DOM nodes should go here. If you need to load data from a remote endpoint, this is a good place to instantiate the network request. Setting state in this method will trigger a re-rendering.
https://facebook.github.io/react/docs/react-component...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question