From 6027a70352b25e28627b11501d7f31eb56ad9c2b Mon Sep 17 00:00:00 2001 From: John Lenehan Date: Thu, 10 Dec 2020 11:46:22 -0500 Subject: [PATCH] Defaults plugins to empty array --- react/ConnectedUIRouter.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/react/ConnectedUIRouter.tsx b/react/ConnectedUIRouter.tsx index 4515da0..9a1db66 100644 --- a/react/ConnectedUIRouter.tsx +++ b/react/ConnectedUIRouter.tsx @@ -27,7 +27,9 @@ export function ConnectedUIRouter({ // services plugin is necessary for UIRouter to function router.current.plugin(servicesPlugin); // apply all the plugins that are passed via props - plugins.forEach(plugin => router.current.plugin(plugin)); + (plugins || []).forEach( + plugin => router.current.plugin(plugin) + ); // apply the newly created redux plugin router.current.plugin(reduxPlugin.current);