fix: crash when opening a random unregistered route

This commit is contained in:
thecodrr
2021-02-26 10:11:47 +05:00
parent 78956c9b79
commit 6e17023141

View File

@@ -10,6 +10,7 @@ const cache = {};
function CachedRouter() {
const RouteResult = useRoutes(routes, { fallbackRoute: "/" });
useEffect(() => {
if (!RouteResult) return;
NavigationEvents.publish("onNavigate", RouteResult);
const key = RouteResult.key || "general";