Fixed some objects that don't like the new props.

This commit is contained in:
2018-10-25 07:31:11 +11:00
parent 37114b2ad6
commit 88e0d6f4ab
6 changed files with 88 additions and 88 deletions

View File

@ -29,17 +29,16 @@ import { HashRouter, Route, Switch } from 'react-router-dom';
import Loadable from 'react-loadable';
const PageLoading = (props) => {
if(props.error) return <span>Loading Error</span>;
if(props.pastDelay) return <span>Loading...</span>;
let { error, pastDelay } = props;
if(error) return <span>Loading Error</span>;
if(pastDelay) return <span>Loading...</span>;
return null;
};
export const RouteWrapper = (props) => {
let { page } = props.page;
let render = () => {
let CustomLoadable = Loadable({
loader: page,
loader: props.page,
loading: PageLoading
});
return <CustomLoadable />
@ -49,7 +48,7 @@ export const RouteWrapper = (props) => {
};
export default withRouter((props) => {
const { match, location, history, children } = this.props;
const { match, location, history, children } = props;
return (
<Route>