Files
pupil.brain.riken.jp/src/components/PageNotFound.tsx
T

44 lines
1.1 KiB
TypeScript

import React, { Component } from 'react';
import Helmet from 'react-helmet';
import { RouteComponentProps } from 'react-router';
interface Props extends RouteComponentProps { }
class PageNotFound extends Component<Props> {
private url = '/';
componentDidMount() {
this.goToTopPage();
}
componentDidUpdate() {
this.goToTopPage();
}
goToTopPage() {
if (this.props.match.url !== '/') {
setTimeout(() => {
console.log(this.props.match);
this.props.history.push(this.url);
}, 5000);
}
}
render() {
return (
<div>
<Helmet>
<title>Page Not Found - Pupil Platform</title>
</Helmet>
<h1>Page Not Found</h1>
<section>
<p>The page you were trying to access doesn't exist or has been removed.</p>
<p>If the page does not automatically reload, please click <a href={this.url}>here</a></p>
</section>
</div>
);
}
}
export default PageNotFound;