SolidJS

S

SolidJS

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

Join

Why does this loop infinitely

The following code calls serverFunc endlessly ```ts export default function Test() { const [people, setPeople] = createStore([ { id: '19' },...

Cache Auth Wrapper

How can I create a wrapper for the cache/action functions so that they include the auth check? So I'd like to go From ```ts...

How are you supposed to satisfy refs when not forwarding to a pure DOM node?

```ts function Example() { let controller: { open(): void } | undefined return <> <button onClick={() => controller?.open()}>Open</button>...

How to avoid passing too many props?

I recently made a component with like 20 mandatory props. How could I have reduced them while keeping type safety?

Cache with sanity

Hi everyone I'm using cache to request my sanity data, but who I can "forgot" the cache when update something on the sanity?...

Confused between For and index

Could someone please explain this a little more in depth, I am not able to follow the explanation on the tutorial.
No description

Can I nest cache functions

Can I nest cache functions and does it prevent multiple calls to the db, for instance ```ts export const getAuthCache = cache(async () => { 'use server'...

Production build in solid start is broken with vanilla extract

It seems that vanilla extract breaks the production build of solid start. No issue at all in dev mode. Anyone has managed to get it working? This is the portion of code that's breaking portion of code ```typescript if (router.target === "browser") {...
No description

useParams() returns params with unknown values

I'm trying to ssr a page with a dynamic parameter, but the parameters I get on the server are unknown. They are available in the preload function. Worst part is that I think this used to work a few days ago, and now it doesn't and it seems I've broken it somehow. ``` interface RouteProps { id: string }...

How to get 'client side' createResource behavior in SolidStart?

I noticed that if I don't have Suspense component in SolidStart, the whole page refreshes and createResource loading state doesn't render at all. For example if use this snippet from regular docs in solidstart project: ```...

Add scripts to header from string

Hi everyone I want to add a few scripts to my header, but I want to receive these scripts from Sanity CMS, so I will receive it as string. Any way to do it?...

template2 is not a function

Hey! I've been struggling a bit with a weird hydration error for a while and someone else posted this: https://discord.com/channels/722131463138705510/1295459352555294800. I get the same error but I don't have any duplicate <body> tags. Can we please reopen this or what would you guys suggest? I investigated it down to that in packages/solid/web/src/index.ts:136, we call getNextElement() with no arguments, but getNextElement from dom-expressions end up calling template() where template is it's first and only argument, here undefined. Is there a mismatch in solidjs 1.0.9 and dom-expressions?...
No description

custom css classes not applied somehow

Hi, i have this code: ```tsx <For each={alertsManager.getAlerts()}>...

Losing reactivity when importing a signal from a library that uses SolidJS

Hey 👋 I have a library that uses SolidJS, and a few projects that import said library. I have the following code in one of my library's util files: ```ts...
No description

Display relative time as signal

Hi, I want to display the relative time of a date. I have this file: ```ts const units: { unit: Intl.RelativeTimeFormatUnit; ms: number }[] = [...

SolidStart 1.0 and Deno 2.0

I think these two technologies sound very interesting together. Is there currently a happy path to trying them out?

Issues when using SolidJS with child web components

Hi, I have problems passing properties to web components that is wrapped in certain web component (modus-toolbar in this case). According to docs I should use "prop:*" but that doesn't compile. It works when I use "attr:*", but this breaks intellisense. And I'm confused because when I hardcode string it works without any prefixes. I create stackblitz example: https://stackblitz.com/edit/solidjs-templates-7qjaxe?file=src%2FApp.tsx Thanks for looking into this 🙂...

is there a way to start data fetching before component rendering?

react router runs the loader before the component. thus making things like redirects easier. is there a way to do this with @solidjs/router? ```tsx export const routes = createRoutesFromElements( <> <Route...

Store with const obj values passed to it does not update.

```tsx const initialViewable = { itemSource: true, itemCategory: true, itemType: true,...