finn
finn
Explore posts from servers
SSolidJS
Created by finn on 4/18/2025 in #support
SolidJS Router Missunderstanding
Figured it out thanks for your help :)
6 replies
SSolidJS
Created by finn on 4/18/2025 in #support
SolidJS Router Missunderstanding
import type { ParentComponent } from "solid-js";
import { render } from "solid-js/web";
import { Router, Route } from "@solidjs/router";

import Home from "./routes/Home";
import Test from "./routes/Test";

const App: ParentComponent = (props) => (
<>
<h1>Root header</h1>
{props.children}
</>
);

render(
() => (
<Router root={App}>
<Route path="/" component={Home} />
<Route path="/test" component={Test} />
</Router>
),
document.getElementById("app")!
);

export default App;
import type { ParentComponent } from "solid-js";
import { render } from "solid-js/web";
import { Router, Route } from "@solidjs/router";

import Home from "./routes/Home";
import Test from "./routes/Test";

const App: ParentComponent = (props) => (
<>
<h1>Root header</h1>
{props.children}
</>
);

render(
() => (
<Router root={App}>
<Route path="/" component={Home} />
<Route path="/test" component={Test} />
</Router>
),
document.getElementById("app")!
);

export default App;
This is my current version which just gives me a white page
6 replies
SSolidJS
Created by finn on 4/18/2025 in #support
SolidJS Router Missunderstanding
and is there anything else I need to add/modify? or just assign routes now in that render method
6 replies