React

ReactJS Practical Questions - class extends react

3.

What do you need to change about this code to get it to run?

import react from 'react';

class Greeting extends React.Component {
  render() {
    return <h1>Hello, {this.props.name}!</h1>;
  }
}

// Usage example
const App = () => {
  const userName = "John";
  return <Greeting name={userName} />;
};

Capitalize render.

Add quotes around the return value.

Capitalize react.

The code is already correct.