In explaination it says that the "componentwillmount" will not work , and it's not working. So how can i move forward?

Tell us what’s happening:
Describe your issue in detail here.

  **Your code so far**

class MyComponent extends React.Component {
constructor(props) {
componentWillMount() {
  // Change code below this line
    componentDidMount() {
console.log('Component being mounted');

  // Change code above this line
render() {
  return <div />
  **Your browser information:**

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

Challenge: Use the Lifecycle Method componentWillMount

Link to the challenge:

Hi @avengers2k17 !

Welcome to the forum!

You are not able to move onto the next lesson because you have syntax errors.
You should be seeing this in the console.

The error message is trying to tell you where the issue is.
Take a close look at what you did here

You are trying to nest a componentDidMount inside a componentWillMount

Once you fix that then the test will pass

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