import React, { Component } from 'react'; export class Counter extends Component { static displayName = Counter.name; constructor(props) { super(props); this.state = { currentCount: 0 }; this.incrementCounter = this.incrementCounter.bind(this); } incrementCounter() { this.setState({ currentCount: this.state.currentCount + 1 }); } render() { return (
This is a simple example of a React component.
Current count: {this.state.currentCount}