import React from 'react'; import { Link } from 'react-router-dom'; import { Button } from '../components/'; import './error.scss'; export class NotFoundPage extends React.Component { constructor(props){ super(props); this.state = { timeout: 10 }; } componentDidMount(){ this.countdown(); } countdown(){ if(this.state.timeout > 0){ this.setState({timeout: this.state.timeout - 1}); window.setTimeout(() => { this.countdown(); }, 1000); }else{ this.props.history.push("/"); } } render() { return (
You will be redirected to the homepage in {this.state.timeout} seconds