kaxa
kaxa
SSolidJS
Created by mrVinicius on 4/1/2024 in #support
Router isn't working.
In /web directory
30 replies
SSolidJS
Created by mrVinicius on 4/1/2024 in #support
Router isn't working.
The app shouldn't be running without node modules so you might have it installed but just incase in the terminal type
npm install
npm install
30 replies
SSolidJS
Created by mrVinicius on 4/1/2024 in #support
Router isn't working.
Hmm, looking at your project I don't see any node modules
30 replies
SSolidJS
Created by mrVinicius on 4/1/2024 in #support
Router isn't working.
Oh yeah thats true...
30 replies
SSolidJS
Created by mrVinicius on 4/1/2024 in #support
Router isn't working.
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>

<script src="/src/index.tsx" type="module"></script>
</body>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>

<script src="/src/index.tsx" type="module"></script>
</body>
30 replies
SSolidJS
Created by mrVinicius on 4/1/2024 in #support
Router isn't working.
and you need to target the index.tsx in html file
30 replies
SSolidJS
Created by mrVinicius on 4/1/2024 in #support
Router isn't working.
This is mine and the div has id of root
30 replies
SSolidJS
Created by mrVinicius on 4/1/2024 in #support
Router isn't working.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<link rel="shortcut icon" type="image/ico" href="/src/assets/favicon.ico" />
<title>Solid App</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>

<script src="/src/index.tsx" type="module"></script>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<link rel="shortcut icon" type="image/ico" href="/src/assets/favicon.ico" />
<title>Solid App</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>

<script src="/src/index.tsx" type="module"></script>
</body>
</html>
30 replies
SSolidJS
Created by mrVinicius on 4/1/2024 in #support
Router isn't working.
Is the Element with the id of "root" or "app"
30 replies
SSolidJS
Created by mrVinicius on 4/1/2024 in #support
Router isn't working.
Ok in the index.html
30 replies
SSolidJS
Created by mrVinicius on 4/1/2024 in #support
Router isn't working.
The error was on which line exactly? Based on the screenshot
30 replies
SSolidJS
Created by mrVinicius on 4/1/2024 in #support
Router isn't working.
Can you attach it to root Component and then render it that way?
const Root= (props) => (
<>
{props.children}
</>
);

render(() => (
// <Home/>
<Router root={Root}>
<Route path={"/"} component={Home} />
</Router>
), document.getElementById("app")
);
const Root= (props) => (
<>
{props.children}
</>
);

render(() => (
// <Home/>
<Router root={Root}>
<Route path={"/"} component={Home} />
</Router>
), document.getElementById("app")
);
30 replies
SSolidJS
Created by mrVinicius on 4/1/2024 in #support
Router isn't working.
But not sure, It should work
30 replies
SSolidJS
Created by mrVinicius on 4/1/2024 in #support
Router isn't working.
Oh maybe because You have Route written like this
<Route path={"/"} component={Home}></Route>
<Route path={"/"} component={Home}></Route>
instead of
<Route path={"/"} component={Home} />
<Route path={"/"} component={Home} />
30 replies
SSolidJS
Created by mrVinicius on 4/1/2024 in #support
Router isn't working.
Try
import {render} from "solid-js/web";
import {Route, Router} from "@solidjs/router";
import Home from "./Home"; // if Home.tsx is in same directory as index

render(() => (
<Router>
<Route path="/home" component={Home}/>
</Router>
), document.getElementById("app")
);
import {render} from "solid-js/web";
import {Route, Router} from "@solidjs/router";
import Home from "./Home"; // if Home.tsx is in same directory as index

render(() => (
<Router>
<Route path="/home" component={Home}/>
</Router>
), document.getElementById("app")
);
30 replies
SSolidJS
Created by mrVinicius on 4/1/2024 in #support
Router isn't working.
You're importing Home from "./HelloWorld" But your Home file is Home.tsx as shown in the snippet
30 replies
SSolidJS
Created by kaxa on 3/29/2024 in #support
Can't find replace attribute on <Navigate />
I've noticed that
return <Show when={!isLoading()}>{props.children}</Show>;
return <Show when={!isLoading()}>{props.children}</Show>;
and
const resolved = children(() => !isLoading() && props.children);

return <>{resolved()}</>;
const resolved = children(() => !isLoading() && props.children);

return <>{resolved()}</>;
do the same thing
21 replies
SSolidJS
Created by kaxa on 3/29/2024 in #support
Can't find replace attribute on <Navigate />
Thank you very much
21 replies
SSolidJS
Created by kaxa on 3/29/2024 in #support
Can't find replace attribute on <Navigate />
Oh yeah, that totally works haha
21 replies
SSolidJS
Created by kaxa on 3/29/2024 in #support
Can't find replace attribute on <Navigate />
I've tried without it, and it didn't show children
21 replies