hua guo
hua guo
Sep 5, 2018 · 1 min read

Async rendering will cause componentWillMount to trigger multiple rendering of your component tree. This makes it unsafe.

according to the doc. the componentWillMount will be called several times on one update. you cited that “trigger multiple rendering of your component tree”. so it is recommended to make componentWillMount pure function.

please correct me if i was wrong.

    Written by

    hua guo

    Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
    Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
    Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade