React InLine Styles won't pass

No matter what I do, the test doesn’t seem to pass and when I check the browser console, it says that styles has not been defined.

Any help will be greatly appreciated,

Code is below

// Change code above this line
class Colorful extends React.Component {
  render() {
    // Change code below this line
      const styles = {
      color: 'purple',
      fontSize: 40 ,
      border: "2px solid purple",
      };

    return (
      <div style={styles}>Style Me!</div>
    );
    // Change code above this line
  }
};

Hi @oseiyaw. Welcome to FCC. I believe the test is expecting you to declare the styles variable before the component declaration.

Just before the first comment above. It would be easier to help if you provided a link to the challenge. You can click Get Help button and then Ask for Help link. That will enable you ask a question automatically adding a link to the challenge in question.

Thank you, I didn’t even see that comment above the code.

1 Like