React

ReactJS Practical Questions - How do you fix the s...

23.

How do you fix the syntax error that results from running this React code?

import React from 'react';
    import ReactDOM from 'react-dom';

   export function App() {
     return (
       <div>
         <h1>Hello, World!</h1>
     );
   };

ReactDOM.render(<App />, document.getElementById('root'));

Wrap the text "Hello, World!" in curly brackets {} after the h1 tag.

Import the component Component from 'react' and extend the App component from Component.

Remove the semicolon ; after the closing curly bracket } of the return statement.

Add a closing tag </div> after the </h1> tag.