React - Render State in the User Interface

Tell us what’s happening:

I am not sure why it’s not passing the last step: The rendered h1 heading element should only contain text rendered from the component’s state.

Your code so far

class MyComponent extends React.Component {
  constructor(props) {
    super(props);
    this.state = {
      name: 'freeCodeCamp'
    }
  }
  render() {
    return (
      <div>
        { /* Change code below this line */ }
        <h1>{this.state.name}</h1>
        { /* Change code above this line */ }
      </div>
    );
  }
};

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:143.0) Gecko/20100101 Firefox/143.0

Challenge Information:

React - Render State in the User Interface

Your solution works from my end. Please try one of the following steps to move forward.

Click on the “Reset” step button and force a refresh of your page with CTRL + F5 if you’re on Windows then try to paste the code in again. On other systems, please follow the instructions here.

or - Try the step in incognito or private mode.

or - Disable any/all extensions that interface with the freeCodeCamp website (such as Dark Mode, Ad Blockers, or Spellcheckers), and set your browser zoom level to 100%. Both of these factors can cause tests to fail erroneously.

or - Ensure your browser is up-to-date or try a different browser.

or - Turn off high contrast themes on Windows (from accessibility settings menu)

I hope one of these will work for you.

I tried resetting and it still didn’t work but I’ll try the other options you’ve provided.

Thanks

1 Like

So I have tried everything you have suggested and still it’s not passing.

im getting this message on the console view: console output
act(…) is not supported in production builds of React, and might not behave as expected.

i can’t see any errors when I copy your code in. It just passes for me.
I use chrome. Maybe try that one (make sure you don’t have any extensions running over it)

Ok Maybe there is something wrong with firefox. I’ll try chrome or safari.

It was firefox causing the issue. Thank very much.

1 Like