SolidJS

S

SolidJS

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

Join

How to check if a variable is a solid-Mutable or -Store?

Is there a way how you can detect if a variable is a createMutable/Store-proxy? It is for the purpose of working with another library's proxies.

For Component

Hello ya'll, i have a <For> component with the following error:
This JSX tag's 'children' prop expects a single child of type '(item: Iinputs, index: Accessor<number>) => Element', but multiple children were provided.
This JSX tag's 'children' prop expects a single child of type '(item: Iinputs, index: Accessor<number>) => Element', but multiple children were provided.
With the following code:...

Streaming Suspense

Is it already possible to display a loader using suspense and streaming ssr?

How to make window.localStorage reactive?

Is there any Solid primitives about window.localStoarge?

How to subscribe a signal using createEffect?

I have a code like this. I want to change v2 value to 0 if v1 value get changed. How to make this using createEffect?...

General component organization question....

Just wondering if there's a better way to organize this file:https://stackblitz.com/edit/solidjs-templates-gguy1g?file=README.md,src%2Fcomponents%2Fbook-parts%2FSlider.jsx It has a lot going on and just feels out of control to me....

How to retrieve params in `createServerAction$`?

Is there a clever way to retrieve the params in a createServerAction$ besides passing it as a parameter or FormData attribute? ```ts const [create, { Form }] = createServerAction$(async (formData: FormData) => { ... });...

Creating a global store like redux

I'm attempting to create a store to keep track of user data across the application and so far this is what I have ```js const userStore = createStore({ username: null, isLoading: true,...

Functions inside store VS outside store?

I want to know what best practice is. I watched some solid youtube tutorials.. Some people put their functions 'get' , 'set' , or 'doSomething' inside store, What's common way???...

How to return field error(s) from server action?

Hi, I'd like to handle field errors when submitting a form using createServerAction$. I understand I can throw a ResponseError but I can't find in the doc how to use it.

Ref

I am getting an interesting error when using a ref to select a canvas. Code works but just wondering if I am using ref the right way. The error is Variable 'canvasRef' is used before being assigned.ts(2454) am I doing something wrong? ...

function MyComponent() vs arrow function Component

I am relatively new to the design space of component systems and figuring it all out. I still don't understand the tradeoffs and standards for why to use different syntaxes for declaring components. Basically, what is the best way or what are the tradeoffs between defining components in these different ways? ```jsx const MyComponent = (props) => { // logic...

client-side rendered solid-start, router and vercel

I am trying to deploy a CSR solid-start project to vercel. When I enter the route from the root and then navigate to a sub-route, I get properly routed, but if i directly go to a route I get a 404. Locally it works as expected. Is there something I need to add to my config for this to work?...

SolidStart release date

Sorry if this question is annoying, but how long do you think until SolidStart is releasing? I'm now so I don't know how much time these things take. This question is not to offend or something, just interested.

How to make child as props in For loop?

This is the way I come up. But is this right? I want to know most general pattern... I know there is props.children. But I don't see any example in 'For' loop. I want to use For's index....

How to use length for 'For'?

Sometimes I want to just use loop's length, instead of each like js's for loop. Should I always provide array to use For? Can I do something like this picture?...

Setting up polyfills in Solid Start

Any insights on how to set up Polyfills when using solid start? Using it client side only for the moment and appearently solid seems to use some quite recent features. To what extent can it be polyfilled? i know IE11 is off the table due to proxys. Are there any other dealbreaker features like that, which can't be polyfilled or transpiled?...

Suspense

Can someone explain the part on why I shouldn't jump into using it? I don't understand https://www.solidjs.com/tutorial/async_suspense Thank you...

Passing data from route to layout in solid-start

I have a group of pages with one parent layout (ie /menu/lunch, /menu/dinner, with the layout under menu.tsx). The layout has a tab bar listing each of the pages under /menu. The color of this tab bar should change depending on the current route. Therefore I would like to be able to specify the color in the routeData of that route and read it from the layout but it appears this is not possible (and I can see why things would get confusing if this were the case). What is the best way to pass da...

Using custom element tags in JSX

I like to use descriptive custom elements e.g. <image-container> instead of <div> soup. Coming from Svelte, is there a way to make VSCode's tsx typescript checker not yell at me for doing this? It seems Solid itself handles it fine.