React

ReactJS Practical Questions - The output of the fo...

2.

What is the output of the following React code?

import React from 'react';

function App() {
  const name = "John";
  return (
    <div>
      <h1>Hello, {name}!</h1>
    </div>
  );
}

export default App;

"Hello, John!"

"Hello, {name}!"

An error will occur

An empty page will be displayed