← React Beginner Questions - Set 7 Q70

What is the role of the render method in React?

React Beginner Questions - Set 7

Example

class Clock extends Component {
  state = { now: Date.now() };
  render() {
    // must be pure: no side effects, no state writes
    return <time>{new Date(this.state.now).toISOString()}</time>;
  }
}

What to notice

← Back to the question list