D
D
deemaagog2018-11-15 00:52:44
React
deemaagog, 2018-11-15 00:52:44

React: What's the best way to implement component update?

There is a component in which a third-party lib is used for rendering, that is, in render simply

render() {
    return <div ref={(el) => (this.сontainer = el)} />
  }

and all the logic is in componentDidMount (initialization) and componentDidUpdate (props change processing)
The problem is that initialization takes some time, during which updated props have time to arrive. But I can't process them until the initialization is finished.
What can be done in this situation?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question