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.
Correct: D
In JSX, every opening tag should have a corresponding closing tag. Adding a closing tag </div> after the </h1> tag will fix the syntax error caused by the missing closing tag in the return statement.