Chronove
Chronove
SSolidJS
Created by Some Call Me Tim on 4/11/2024 in #support
Solid Start Route for simple redirect
If the html/css part is an issue, why not straight up use an api route? Ex. src/routes/getRandom.ts
export function GET(){
const id = Math.floor(Math.random() * 1000);
return Response.redirect(`/api/randomImg?${id}`, 301);
}
export function GET(){
const id = Math.floor(Math.random() * 1000);
return Response.redirect(`/api/randomImg?${id}`, 301);
}
API Routes should run on the server afaik
4 replies
SSolidJS
Created by KokoNeot on 4/6/2024 in #support
order of reactivity
I'd say a better workaround would be to use the proper components for it. Solid does provide a switch/match component, making it:
<Switch>
<Match when={displayMode() == "customer" && !orders.loading}>
<ByCustomerTable orders={orders()} />
</Match>
<Match when={displayMode() == "product" && !orders.loading}>
<ByProductTable orders={orders()} />
</Match>
</Switch>
<Switch>
<Match when={displayMode() == "customer" && !orders.loading}>
<ByCustomerTable orders={orders()} />
</Match>
<Match when={displayMode() == "product" && !orders.loading}>
<ByProductTable orders={orders()} />
</Match>
</Switch>
7 replies
SSolidJS
Created by captaindaylight. on 4/3/2023 in #support
Passing For Id between InputGroup and Input using children
- Element props should not be destructured, else they will lose reactivity - You c/s-hould use the error render as a fallback (it's an attribute of the Show Element) - instead of creating your own forId you should use createUniqueId() (https://www.solidjs.com/docs/latest/api#createuniqueid) or even just a createMemo instead of a signal which never gets changed For the error you're getting, I don't know the types of child or InputGroupProps so I can only guess that the types aren't correct, as you're error "Property props does not exist..." sounds like a typescript error to me.
6 replies