SolidJSS
SolidJS2y ago
2 replies
Carrot Rübe

SolidJS routing not working, needs to reload the page.

Whenever I try to go to another page I have to reload the page.
I use Tauri, SolidJS and vite.

sidebar.jsx
           <nav>
                <li id="link-library">

                    <nav>
                    <A href="/my-library" activeClass="underlined" inactiveClass="default">
                        <p className="links-texts">My Library</p>
                    </A>
                    </nav>

                </li>
            </nav>

App.jsx
    const sidebarRoutes = [
        {
            path: "/",
            component: lazy(() => import("./templates/gamehub-01/Gamehub")),
        }, 
        {
            path: "/my-library",
            component: lazy(() => import("./templates/mylibrary-01/Mylibrary"))
        }
    ]

  return (
            <div className="app-container">
                <div className="main-content">
                    <div className="searchbar">
                        <Searchbar />
                    </div>
                    <Router>
                        {sidebarRoutes}
                    </Router>
                </div>
            </div>
)

index.js
render(() => ( 
    <Router root={App}></Router>
    ), document.getElementById("root"));
Was this page helpful?