Web / ReactJS Interview questions
How do you create a Class component in React?
React lets you define components as classes or functions. To define a React component class, you need to extend React.Component.
class Hello extends React.Component { render() { return <h1>Hello, {this.props.username}</h1>; } }
You must define in a React.Component subclass, the only method named render().
More Related questions...