import * as React from 'react';

interface CounterState {
    currentCount: number;
}

export class Counter extends React.Component<void, CounterState> {
    constructor() {
        super();
        this.state = { currentCount: 0 };
    }
    
    public render() {
        return <div>
            <h2>Counter</h2>
            
            <p>This is a simple example of a React component.</p>

            <p>Current count: <strong>{ this.state.currentCount }</strong></p>
            
            <button onClick={ () => { this.incrementCounter() } }>Increment</button>
        </div>;
    }
    
    incrementCounter() {
        this.setState({
            currentCount: this.state.currentCount + 1
        });
    }
}
