SolidJSS
SolidJSโ€ข3y agoโ€ข
26 replies
Abrinzer

Make sure your app is wrapped in a <Router />

I have a mini app which contains its own route path something like below . This root component is exported out and is being used in main app as a package dependency. Below is the usage

mini-app code
 <Route path="/path1" component={MainLayout}>
      <Route path="/" element={<Navigate href='/home'/>}/>
      <Route path="/home" component={() => <div>Hi</div>} />
    </Route>


In the main app usage looks like below
<Router>
  <Routes>
     <Route path="/" component={MainLayout}>
       <Route path="/account" component={Account} />
       <Route path="/bills" component={Bills} />
        <MiniApp />
     </Route>
   </Routes>  
</Router>
Was this page helpful?