From 628e76668ea72baebdb02b9dcfe24c0da837fb08 Mon Sep 17 00:00:00 2001 From: Ely Lucas Date: Thu, 7 Nov 2019 10:00:17 -0700 Subject: [PATCH] fix(react): add check to warn if no ionpage is found, fixes #19832 (#19857) --- packages/react-router/src/ReactRouter/Router.tsx | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/packages/react-router/src/ReactRouter/Router.tsx b/packages/react-router/src/ReactRouter/Router.tsx index 863619bb2d2..742a9235136 100644 --- a/packages/react-router/src/ReactRouter/Router.tsx +++ b/packages/react-router/src/ReactRouter/Router.tsx @@ -4,7 +4,7 @@ import { Action as HistoryAction, Location as HistoryLocation, UnregisterCallbac import React from 'react'; import { RouteComponentProps, matchPath, withRouter } from 'react-router-dom'; -import { generateId } from '../utils'; +import { generateId, isDevMode } from '../utils'; import { LocationHistory } from '../utils/LocationHistory'; import { IonRouteData } from './IonRouteData'; @@ -169,6 +169,18 @@ class RouteManager extends React.Component { + const { view } = this.state.viewStacks.findViewInfoById(this.activeIonPageId); + if (view!.routeData.match!.url !== location.pathname) { + console.warn('No IonPage was found to render. Make sure you wrap your page with an IonPage component.'); + } + }, 1000); + } + } } }); }