SolidJS

S

SolidJS

Solid is a declarative reactive Javascript library for creating user interfaces.

Join

How to keep an active item for a list of items in SolidJS?

https://stackoverflow.com/questions/79209391/how-to-keep-an-active-item-for-a-list-of-items-in-solidjs My app has a list of items where each item is an object, and one of the items can be in active state. I'm using SolidJS. My first idea was to represent the whole state of the app in a store:...

Reactive conditional rendering based on Store of objects

Heres an example of what I am trying to do: ```typescript import { For, type Component } from "solid-js"; import { createStore } from "solid-js/store";...

Rendering <input>s in <For>

How can I reference a dynamic number of <input>s to read their value? Thanks....

Does createAsync cause double renders on the server i.e an extra render after data becomes available

Was observing from the logs ``` (procirement) route ProcurementProvider getProcurementRouteData...

Throw vs return in router’s action

Suppose I have an action that should redirect. In the docs(https://docs.solidjs.com/solid-router/reference/data-apis/action) I found example of both returning and throwing a redirect. Which should be used and when?...

SSR failed to import "drizzle-orm/bun-sqlite"

Hi, here's the error I get ``` 1:20:01 PM [vite] Error when evaluating SSR module /src/db/index.ts: failed to import "drizzle-orm/bun-sqlite" |- Error [ERR_UNSUPPORTED_ESM_URL_SCHEME]: Only URLs with a scheme in: file, data, and node are supported by the default ESM loader. Received protocol 'bun:' at throwIfUnsupportedURLScheme (node:internal/modules/esm/load:228:11)...

Weird Vinxi dev issue

Anytime I call/use this function, it seems to completely break vinxi's build in dev and throws a crazy weird error.

Solid devtools with Astro

I try to use solid devtools extension with Astro but is shows Solid Not Detected. Webpage work fine with solidjs. I edit astro.config.mjs file in Astro ``JavaScript...

CI only error: no such file or directory server-functions-manifest.json

I am getting a no such file or directory error while vinxi build is running for the server-functions-manifest.json. It only happens in ci, in both vercel and cloudflare pages. With start 1.0.10 & vinxi 0.4.3. Just in case somebody saw this one before, has a clue what I could be doing wrong. I saw some messages previously with this error, but only when the build output folder is changed. Which I did not, however by start app is inside a mono repo. Full project is available here. Its a bit messy atm: https://github.com/hkviz/hkviz-web/tree/move-to-solid-start/packages/app2 logged error of vinxi build in thread...

Nested layouts with dynamic route

I am using solid start with file based routing. I want to create routes with nested layout. I want to have routes /plans/[id] and /plans/[id]/select. Both of these routes should share same layout, how can I acheive it with dynamic paremeter?

`useNavigate` inside an `action`?

I am trying to use useNavigate in an action when my form is submitted. However my page isn't navigating. No errors appear in console. ``` const some_action = action(async (data) => {useNavigate()("/")}) ...

All of a sudden `classList` is typed as string | undefined

I am using SolidJS with Astro and at one point I duplicated a component file to extract logic into it and now class and classList have unexpected types: ```src/Wes95/components/Window.tsx:159:14 - error ts(2322): Type '{ children: Element[]; class: string; }' is not assignable to type 'HTMLAttributes<HTMLDivElement>'. Property 'class' does not exist on type 'HTMLAttributes<HTMLDivElement>'. ...

Handling 404 within existing catch-all route

Wondering what the pattern/best approach is for displaying a 404 page/component within a catch-all route. Using solid start/<FileRoutes>, if I have a number of static file routes, and an [...index].tsx catch-all to handle the CMS routes. Can't have another catch-all (right?) rough setup is:...

I get ERR_UNHANDLED_REJECTION

Hey all, I am using the solidstart drizzle example wiht login. solidstartversion: "@solidjs/start": "1.0.6", nodeversion 23.2 I try to run this code. ...

Vite keeps loading the packages first before @solidjs/router

Hi, is there any way to tell vite to load my custom package (that uses solidjs router as dependency) after loading the solid router? I kept getting errors like use-hooks must be called within Router

hook

Can I destructure my hook in SolidJS? It returns values via an anonymous function and doesn't lose reactivity. Is it bad?

Problems to acess objects inside an array

Hey guys, im trying to make a game with solid js using it as my interface library, but im having this weird behavior on createStore signal. I have this store: export const [spaceShip, setSpaceShip] = createStore({ name:"Galahdyx 5C", inventory:{...

Handling <input>

Is this a correct way to handle <input> fields? <input onInput={e => setUserName(e.target.value)} value={userName()} /> Or should I use a ref instead and read the field value when it is needed?...
Next