K
K
KnightForce2017-05-14 01:36:25
React
KnightForce, 2017-05-14 01:36:25

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

1 answer(s)
I
Islam Ibakaev, 2017-05-14
@KnightForce

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 question

Ask a Question

731 491 924 answers to any question