1.
What is the output of the following React code?
import React from 'react';
function App() {
return (
<div>
<h1>Hello, World!</h1>
</div>
);
}
export default App;
"Hello, World!"
An error will occur
An empty page will be displayed
Nothing will be displayed on the page
Correct: A
The code renders a single React component called App, which returns a JSX element containing a div element with an h1 element inside. The text "Hello, World!" will be displayed on the page.
1 / 30