/* eslint-disable */ import React from 'react'; import Link from 'umi/link'; import withRouter from 'umi/withRouter'; import 'whatwg-fetch'; import guessJSFileFromPath from './guessJSFileFromPath'; import styles from './NotFound.less'; class NotFound extends React.Component { constructor(props) { super(props); this.state = { loading: true, routes: [], }; } componentDidMount() { fetch('/__umiDev/routes') .then(res => res.json()) .then(routes => { this.setState({ loading: false, routes, }); }); } renderRoutes(routes) { return ( ); } render() { const { location, pagesPath, hasRoutesInConfig } = this.props; const jsFile = guessJSFileFromPath(location.pathname); return (

umi development 404 page

There's not a page yet at {location.pathname}.

Create a React.js component in your pages directory at{' '} {pagesPath}/{jsFile} {' '} {do { if (hasRoutesInConfig) { `and configure the route in config file `; } else { (''); } }} then this page will automatically refresh to show the new page component you created.

Your Routes

{do { if (this.state.loading) {
Loading routes...
; } else { this.renderRoutes(this.state.routes); } }}
); } } export default withRouter(NotFound);