cherif_b
cherif_b
SSolidJS
Created by cherif_b on 8/14/2023 in #support
Signal cross bound a route
Thank you, I'll try it @._rb I'm seeing different behavior between config based routing and regular routing, thank you @._rb and @draw.uy
8 replies
SSolidJS
Created by cherif_b on 8/14/2023 in #support
Signal cross bound a route
export const routes: RouteDefinition[] = [
{
path: '/:folder',
component: Emails,
}
]

const App: Component = () => {
const folderp = useParams().folder
const [folders, setFolders] = createSignal(availableFolders);
const [folder, setFolder] = createSignal("inbox");
const [emails, setEmails] = createSignal(allEmails);
const folderEmails = () => emails().filter(email => {
return email.folders.indexOf(folder()) > -1
});

console.log(folderp)

const Routes = useRoutes(routes);

const navigate = useNavigate();
navigate(folder());

return (
<div>
<header>
<Toolbar></Toolbar>
</header>
<aside>
<ul>
<For each={folders()}>
{(folder, i) => (
<li>
<A href={`/${folder.id}`}>{folder.name}</A>
</li>
)}
</For>
</ul>
</aside>
<main>
<Routes />
{/* <Emails emails={folderEmails()} /> */}
</main>
</div>
);
};
export const routes: RouteDefinition[] = [
{
path: '/:folder',
component: Emails,
}
]

const App: Component = () => {
const folderp = useParams().folder
const [folders, setFolders] = createSignal(availableFolders);
const [folder, setFolder] = createSignal("inbox");
const [emails, setEmails] = createSignal(allEmails);
const folderEmails = () => emails().filter(email => {
return email.folders.indexOf(folder()) > -1
});

console.log(folderp)

const Routes = useRoutes(routes);

const navigate = useNavigate();
navigate(folder());

return (
<div>
<header>
<Toolbar></Toolbar>
</header>
<aside>
<ul>
<For each={folders()}>
{(folder, i) => (
<li>
<A href={`/${folder.id}`}>{folder.name}</A>
</li>
)}
</For>
</ul>
</aside>
<main>
<Routes />
{/* <Emails emails={folderEmails()} /> */}
</main>
</div>
);
};
8 replies
SSolidJS
Created by cherif_b on 8/14/2023 in #support
Signal cross bound a route
I tried to but it always returns undefined
8 replies