SolidJS

S

SolidJS

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

Join

Iterating routes don't work

For some weird reason the code in this image doesn't work as expected

createResource as initial value with store

Hi, is there a way to combine the behaviour of createResource and createStore? What I essentially want to achieve, is to fetch a resource and populate a store with the data. But since doing something like this with createEffect I was wondering, what the best way to do this would be? Essentially the flow should be:...

Prpc and Suspense question

```js const Stats: ParentComponent = () => { const allStatsPersonal = allStats({ value: "all" }); return (...

Prefill Input with value from a fetch source - Best practice

Hey folks, I am currently trying to prefill an input field with saved user values. I have basically two things I would like to combine: ...

Is there any scenario where batch wouldn't be fully synchronize?

In that once the call to batch(() => { }) completes all signals inside that have been set can be read . i.e. there is no setImmediate/setTimeout/queueMicrotask in the path?

how to avoid child component re-creation with For

I have a store that is a list of tuples: each tuple is like ["type as string", { item, props }]. One of these items contains a value that I want to change like a controlled input, with a 'value' and a 'setValue' prop. The problem is that when I call "setStore" to update the item value, the entire tuple is a new tuple with the changed value, it's not the same old tuple with the value mutated in place....

Waiting for big component

Hello, I want to wait for a big synchronous component to render while rendering everything else around. After trying: ```tsx...

Html elements have no space in between them

Say in a component I render the following:
<span>foo</span>
<A href="/url">link</A>
<span>foo</span>
<A href="/url">link</A>
...

using vanilla js with import?

I am playing around with ways to visualize data and I would like to be able to use vanilla js to do so. I understand that I could do things with onmount and other solid provided techniques but I thought it would be cool to try to import a js file. It did work, but it seems to have been "minified" or whatever happens when your code is built for production. The image provided is actually a whole javascript file that seems to have been stuck inside of index-05a...js , and it works as intended until...

I don't like refs

Not really a solidJS question but there are smart people here. If there's a rule against this I will remove this post. I am storing a bunch of refs in an array like this: <p ref={(el) => setRefs((p) => [...p, el])}...

`ClientOnly` fallback

I found this code for a client that only runs on the client```ts function ClientOnly(props: { children: JSX.Element }) { const [ getRender, setRender ] = createSignal() onMount(() => setRender(() => props.children)) return getRender as any as JSX.Element...

Reactive in case of dynamic data

Hey peeps, I have an object where it can be any random json. Something like this, https://playground.solidjs.com/anonymous/8670f306-cea1-40d4-9a84-3dbc2caa305f It looks like Solid will lose the object reactivity when changing from array to object, vice versa....

Motion one with exitBeforeEnter doesnt do enter animation

So I have presence component with exitBeforeEnter but it doesnt animate the enter animation only the exit anim. The motion.div is not absolute if that matters. I can post some code later if it helps.

The browser resolved template HTML does not match JSX input

Probably due to this i'm unable to click buttons in dev mode but it works in production mode

Cannot exclude an external package from server bundle file

Hello humans. It's been 2 days now that I am struggling with this issue of not being able to exclude @supabase/supabase-js and its dependancies from the final server.js file. I am using Cloudflare workers solid adapter. I've tried all possible combinations to mark the library as external with no luck. Here is my vite.ts file. ``` import solid from 'solid-start/vite' import { defineConfig } from 'vite'...

Which methods do you use for check user login or not?

May I know which methods do you use for check user login or not? Method 1 - Create server session and check database according session details. Method 2 - Use JWT to store in cookies and use that to check in database ...

Solid Router and losing Contexts

When navigating to a route, I noticed I lose all the context values. I have to wrap the component (that needs to rendered for the route) again by all the context providers, and for every route. Is this normal? It seems awkward. (of course I can create some generic component that wraps the component to render for that route with all the context providers again, but is it normal in the first place that I lose the contexts? If so, how do you approach this?) ```tsx <Route path={translate('uri_select_login_auth_method')}...