React

ReactJS Practical Questions - What should the cons...

26.

What should the console display when the following simple React code is run?

import React from 'react';

function App() {
  const greeting = 'Hello, React!';
  console.log(greeting);

  return (
    <div>
      <h1>{greeting} You are awesome! </h1>
    </div>
  );
}

export default App;

"Hello, React!"

"undefined"

There will be an error

"Hello, React! You are awesome!"