It is giving "A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>" this error I checked the react-router documentation but couldn't find the relevant answer.
This code is to allow the user to only render to the paths specified in the array.
<Route
path={[
'/',
'/invite',
'/get_username',
'/code_confirm',
'/allow_notification',
]}
>
<PlanLayout>
<Routes>
<Route path='/' element={<Welcome />} />
<Route path='/invite' element={<PhoneConfirmation />} />
<Route path='/code_confirm' element={<CodeConfirm />} />
<Route path='/allow_notification' element={<AllowNotification />} />
</Routes>
</PlanLayout>
</Route>
<Route path={["/home"]}>
<AppLayout>
<Routes>
<Route path='/home' element={<Home />} />
</Routes>
</AppLayout>
</Route>