Pomodoro timer – implementing the constructor and componentDidMount

To understand componentDidMountwe are going to create a Pomodoro Timer (if you don't know what it is you can read this: https://en.wikipedia.org/wiki/Pomodoro_Technique).

Our Pomodoro timer will look like this:

Creating our Pomodoro Timer:

  1. The first thing we need to do is to create a new folder called Pomodoro in our components directory, as well as a file called Timer.js and the CSS file, Timer.css. This is the skeleton of the class component we will use for this component:
import React, { Component } from 'react';import './Timer.css';class Timer extends Component {

Get React Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.