4 ms·
Fortunately, componentWillMount is largely made redundant by the use of constructors.
by lobster_johnson 10y ago
Fortunately, componentWillMount is largely made redundant by the use of constructors.
- madeofpalk 10y agoExcept it's not for when you actually want to know when the component was put into the DOM, or you're running react server-side
- wayfarer2s 10y ago> when you actually want to know when the component was put into the DOM You can use componentDidMount for that and its semantics are still the same.
- danabramov 10y agoYes, componentDidMount is the place to work with DOM. componentWillMount never worked this way—it is basically a glorified constructor from pre-ES6 era.
- madeofpalk 10y agoOh apologies - I really the comment as componentDidMount. My bad.