Abdo
Abdo
SSolidJS
Created by Abdo on 1/1/2024 in #support
Help with solid-router
So i'm trying to to use solid router options like useNavigate and useIsRouting but i get the error
Error: Make sure your app is wrapped in a <Router />
Error: Make sure your app is wrapped in a <Router />
idk what i'm doing wrong i followed the readme on github here is my index.jsx
/* @refresh reload */
import { render } from 'solid-js/web'

import App from './App'
import "./assets/styles/main.css";

import { Router, Route } from "@solidjs/router";


render(() => (
<Router>
<Route path="/" component={App} />
</Router>
), document.getElementById("app"));
/* @refresh reload */
import { render } from 'solid-js/web'

import App from './App'
import "./assets/styles/main.css";

import { Router, Route } from "@solidjs/router";


render(() => (
<Router>
<Route path="/" component={App} />
</Router>
), document.getElementById("app"));
btw i try to use it in App.jsx
import Navbar from './components/includes/navbar';

import { useNavigate } from '@solidjs/router'
const n = useNavigate()

function App() {
return (
<>
<Navbar />
</>
)
}

export default App
import Navbar from './components/includes/navbar';

import { useNavigate } from '@solidjs/router'
const n = useNavigate()

function App() {
return (
<>
<Navbar />
</>
)
}

export default App
5 replies