'unable to write html in react component [closed]

i was creating my first react component and i was following a tutorial in which we need to create component but I was unable to add html in my component

Im sharing a screenshot of the issue below

enter image description here



Solution 1:[1]

The main problem is in the return statement. You have to use parenthesis to prevent the error. Try this one:

function HelloWorld(){
      return(
         <h1>Hello World</h1>
      );
}

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Rifat Ishtiyak