3 ms·
Several relevant pointers: - https://github.com/facebook/react/issues/7671 https://github.com/facebook/react/issues/7671 - https://twitter.com/dan_abramov/sta
by acemarke 10y ago
Several relevant pointers:
- https://github.com/facebook/react/issues/7671 https://github.com/facebook/react/issues/7671
- https://twitter.com/dan_abramov/status/790590733468241920 https://twitter.com/dan_abramov/status/790590733468241920
- https://www.reddit.com/r/reactjs/comments/5fg7iq/why_should_ajax_requests_go_in_componentdidmount/ https://www.reddit.com/r/reactjs/comments/5fg7iq/why_should_...
- https://daveceddia.com/where-fetch-data-componentwillmount-vs-componentdidmount/ https://daveceddia.com/where-fetch-data-componentwillmount-v...
Also see Lin Clark's "React Fiber" talk, linked upthread. Basically, pieces of work can start and be interrupted, and then be restarted, which will mean that `componentWillMount` can be called several times before the component _actually_ mounts.
- danabramov 10y agoTo be clear this is irrelevant to React 16 which works in sync mode for compatibility. We'll share more about any changes when we start enabling the async mode in Facebook products and figure out the best migration strategy.