document.addEventListener('DOMContentLoaded', () => setTimeout(loadScript, 3000));
const routes = [
{
path: "/login",
component: Login
},
{
path: "/register",
component: Register
},
{
path: "/recover",
component: Recover
}
]
<Switch>
{routes.map(route =>
<motion.div exit="unset">
<Route path={route.path} component={route.component}/>
</motion.div>)}
</Switch>