Https://www.freecodecamp.org/learn/front-end-development-libraries/react/use-the-lifecycle-method-componentwillmount

Tell us what’s happening:
Describe your issue in detail here.
What is the purpose of the method componentWillMount() ?

  **Your code so far**

class MyComponent extends React.Component {
constructor(props) {
  super(props);
}
componentWillMount() {
  // Change code below this line
  console.log("Hello")
  // Change code above this line
}
render() {
  return <div />
}
};
  **Your browser information:**

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.63 Safari/537.36

Challenge: Use the Lifecycle Method componentWillMount

Link to the challenge:

It is an old method that will run after the constructor but before the render. You can read about it here.

You will notice that they are deprecating it. FCC is a little behind as React has continued to advance - that’s OK, you need to know these things anyway.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.