SolidJS

S

SolidJS

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

Join

Accessing parts of a Store (sub store, substore)

I ran into some typing issue with stores. I've got a component that expects a data: T[] and setter: SetStoreFunction<T[]> . This is all fine when passing in a complete store as created by createStore(...) but breaks down if I want to pass a part around: e.g. ```tsx <Foo...

UND_ERR_REQ_CONTENT_LENGTH_MISMATCH error when navigating to index route

My index route looks like this ```tsx export function routeData() { return createServerData$(async (_, { request, fetch: fetcher }) => {...

Pass prop into style={{}} on hover

I need to send a hex-color into the styles that depends on my data, specifically ``` '&:hover': { color: props.color
}...

Global style tags get added before page is actually visible

I'm trying to get a better understanding of how data loading works in Start. It seems that when I have a <Style> tag in a layout, but the actual route takes a long time to load, the Style tag will still render even when the rest of that route is not. Here's the repro: https://github.com/nonphoto/solid-test-global-page-styles

Control when child component is mounted

I am creating a mega menu component which is used in the following way: ``` <MainMenu> <MenuItem title="Products">...

Client only component (or client only createResource)

Hey... I've a component that renders button depending on browser capabilities, so it makes no sense to use ssr. I would like to wrap the capabilities check inside a createResource to use suspense / error boundaries (the browser check PublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable() returns a promise. ...

SolidStart on Plesk

Is it possible to host a SolidStart app at a hoster who supports Node.js via the Plesk "panel"? I have to specify a file to execute, would that just be dist/server.js?...

Best practice working with reactive values inside context provider

I did some experiments using solidjs context. Context as value is not reactive in solid.js. It's a little different from props that are reactive - if you pass signals as props like a={a()} to Child, and access props.a - a is reactive. If I wrap the context value in a function and treat context as Accessor<OriginalContextValue> - it's reactive. If I use a store it's reactive too (but the update needs to be done differently)....

Trigger same API call with different payloads in parallel using CreateResource

I am facing issues with making same API call multiple times with different payloads (using ForEach). I am setting a payload within the store at each iteration and that store proxy is used as a dependency of fetcher function inside createResource export const TriggerAPI = () => { const [dummy] = createResource(getPayload, fetcher); return dummy; };...

esm.sh & router

Hi all, Trying to get solid's router working with esm.sh and SSR in Deno. I've created an issue with esm.sh to support conditionals, but in the meantime does anyone have an idea besides manually bundling for the server? https://github.com/ije/esm.sh/issues/511 ...

Subscribe to

Given the derive signal feedback
const [store, setStore] = createStore({fb: [0,1,2]});
const feedback = store.fb;
const [store, setStore] = createStore({fb: [0,1,2]});
const feedback = store.fb;
...

Strange React not defined error

I've created the bare minimum solidjs + vite app with just and index.html and index.jsx page: ``` import { render } from "solid-js/web"; ...

I get `Invalid left-hand side in assignment expression.` when I assign a value.

I get the error above if I try to assign a value to selectedRate inside the onClick even with the arrow function removed, I still get an error. ```jsx const ratings = [1, 2, 3, 4, 5];...

For component not displaying values

What am I doing wrong here?? ```jsx import { For } from "solid-js"; ...

Component is called twice when using Suspense, createResource and solid router

Hi I have a component that uses createResource. When navigating to a route containing this component, it's called (reevaluated?) twice. Is this what is supposed to happen when using transitions (which the router is using)? Or is it a bug? Is there some documentation for how Suspense is supposed to work? I can try to create a self-contained example if that makes it easier to understand my issue 🙂...

Handling locale dates when SSR

I am trying to display a date with date.toLocaleDateString, however as the page is SSR it is instead showing as the server's locale. Is there a pattern to handle this?

Calling database with server actions in Solid Start

Hey all, I have a question more about best practices than anything. In the Solid Start docs, under the Server Actions heading, it says the following:
Or even connecting directly to a database. (Take caution, opinions on if this is a good idea are mixed. You should consider separating your backend and frontend).
Or even connecting directly to a database. (Take caution, opinions on if this is a good idea are mixed. You should consider separating your backend and frontend).
My question is why this may be considered a bad idea, especially when it's not frowned upon in createServerData$....

ReactiveMap

I am having an issue with reactive map - i think i know why it's happening but i have no idea how to fix it. I have the below code
Setting up the Store (static map just for testing)
```ts...

Using renderToString in node

I have a file that looks roughly like this: ``` import { renderToString } from "solid-js/web" ......