Can anybody tell me , what's wrong is in the code. My Tests are not passing

  **My code so far**

// Change code below this line

import React , {Component} from "react";

class MyComponent extends React.Component {
constructor(props) {
render () {
  return (<h1>
  My First React Component!</h1>)

ReactDOM.render(MyComponent , document.getElementById('challenge-node'));
  **Your browser information:**

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

Challenge: Write a React Component from Scratch

Link to the challenge:

Its render method should return a div that contains an h1 tag with the text: My First React Component! in it.

You’re missing <div>.

thanks for the help.
My ReactDOM.render() method is also not working.

You should use <MyComponent /> in ReactDOM.render.

1 Like

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