From 29073ce47b4bcdd762a85222178fa492fc6c7ff6 Mon Sep 17 00:00:00 2001 From: Nick Hehr Date: Tue, 29 Nov 2022 15:50:03 -0500 Subject: [PATCH] fix(react-router): group index redirect route with steps config (#33) --- packages/react-router/src/context/index.tsx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/react-router/src/context/index.tsx b/packages/react-router/src/context/index.tsx index 2ab3b99..bb205b2 100644 --- a/packages/react-router/src/context/index.tsx +++ b/packages/react-router/src/context/index.tsx @@ -91,7 +91,12 @@ export function Wizard({ children, initialVa navigate(wizard.currentStep); } }); - const step = useRoutes(steps) + const stepsWithRedirect = steps.concat({ + index: true, + element: (), + path: "/" + }); + const step = useRoutes(stepsWithRedirect) const stepFromLocation = location.pathname.split('/').pop(); useEffect(() => { @@ -102,12 +107,7 @@ export function Wizard({ children, initialVa return ( - <> - {step} - - - } /> - + {step} ) }