Write a React Component

Write a React Component
0

#1

it’s showing error:

Your code so far


// change code below this line
class MyComponent extends React.Component{
  constructor(props){
    super(props);
  }
  render(
    return(
    <div>
      <h1>My First React Component!</h1>
    </div>
   );
  )
};

ReactDOM.render(<MyComponent />, document.getElementById("challenge-node"));



Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0.

Link to the challenge:
https://learn.freecodecamp.org/front-end-libraries/react/write-a-react-component-from-scratch


#2

Your syntax is off a bit. You shouldn’t pass a return statement as a parameter in render function.

It should be something like…

render() {
return...
}

#3

yeah i see , thanks :+1:


#4

In the future when you click the Ask for Help button on a challenge, please tell us what your specific question is about the challenge.

Thank you.