Questions tagged [solid-js]

For questions related to the Solid Javascript framework (see solidjs.com)

Solid is a JavaScript library with built-in state management and fine grained reactivity for creating user interfaces.

It is a high performance alternative to React which compiles to real DOM nodes. It supports SSR, streaming and progressive hydration.

242 questions
1
vote
1 answer

When store updates, wait until div is redrawn inside an effect before updating the scroll

I have the following code. The problem is this, inside of the createEffect that listens to topic changes, I want to get new chat messages (which is just an array of randomly generated integers to make this simple), after getting the messages, I want…
Max
  • 81
  • 1
  • 5
1
vote
1 answer

SolidJS crashes with _tmpl$ not a function

I am trying to run a SolidJS script, out of the blue the error below started appearing caught TypeError: _tmpl$3 is not a function at App.tsx:58:3 at App (App.tsx:63:72) at solid.js:1152:24 at untrack (solid.js:414:12) at…
Coffeeholic
  • 367
  • 3
  • 16
1
vote
1 answer

How to render a SolidJS component?

I'm developing a custom menu for my application. My idea is to render inside an element created in the body, a functional component. I'm using createRoot and render for this. export function createMenu(e, Menu) { let x = e.clientX let y =…
rick
  • 554
  • 6
  • 18
1
vote
1 answer

Merge classes from parent component to child component root element in Solid JS

I want to be able to add classes from a parent component to the child component root element in Solid JS like this: const A = () => { return
whatever
} const B = () => { return } // should render
v-moe
  • 1,203
  • 1
  • 8
  • 25
1
vote
1 answer

How to annotate input events in SolidJS?

I have an input that looks like this: handleInput(e)} /> And typescript suggests that e is this type: (parameter) e: InputEvent & { currentTarget: HTMLInputElement; …
RobKohr
  • 6,611
  • 7
  • 48
  • 69
1
vote
1 answer

How to update list items inside child components using Solid JS?

I am new to Solid.js, and am not finding existing docs or Q/A to be very helpful. I have a situation, which I'm sure is a common one, where I want to draw a list of objects as Components that will allow them to be edited. For example, lets say I…
Tim
  • 13
  • 3
1
vote
0 answers

Nx, Vite, SolidJS and Tailwind: how do I configure these?

I am trying to get Nx, Vite, SolidJS and Tailwind to play nicely together. I have hacked around a bit because it seems the Nx SolidJS doesn't work with the current version of Nx. I'm not convinced my postcss config is being read. My serve target in…
serlingpa
  • 12,024
  • 24
  • 80
  • 130
1
vote
1 answer

In SolidJS, how do Signals get repeatedly rendered into the DOM?

I think I understand Signals, Reactions, Derivations quite well in terms of Reactivity. However, I can't understand how all of a sudden, putting them into an App() function and the Signals can be updated into the DOM repeated when the Signals are…
Stefanie Gauss
  • 425
  • 3
  • 9
1
vote
1 answer

Using SolidJS context in async function

Is it possible to get the context value in an async function called from a component? Even runWithOwner() gives me the default value of the context, not the enclosing value, after the first await. const Ctx = createContext('default'); return…
Jay
  • 37
  • 4
1
vote
1 answer

SolidStart client side only rendering

Is there any way to render a component on the client side only in Solid Start. Just like in next js we can use dynamic to get ssr false. Is there any alternative for that in SolidJS? I tried to import module in createEffect.
Jay Pokale
  • 11
  • 2
1
vote
2 answers

SolidJS: Using createEffect to observe signal changes

I have started a new journey with SolidJS after being in the Angularverse since Angular 2 :) I've been following the Effects tutorial on their official website but I'm not able to make it work the way I want. I thought createEffect would keep track…
1
vote
0 answers

Component auth has not been registered yet - SolidJS & Firebase

I'm using SolidJS with solid-firebase npm package. Just as a test I'm using the code from the git repo but when configured with my firebase project I get the error Component auth has not been registered yet App.tsx import type { Component } from…
HarryBilney
  • 45
  • 1
  • 9
1
vote
1 answer

How to pass "read-only" props in SolidJS

I frequently pass properties to Solid components that are read-only for dependency injection of singleton services. See the simplified example below. However the SolidJS lint rules give me errors like: The reactive variable 'props.firestore' should…
JustinM
  • 913
  • 9
  • 24
1
vote
1 answer

Avoid effect reactivity on store variable update

I've declared an effect, something on the lines of: createEffect(async ()=>{ let localvar = 0; if(storeGetter.var1 && storeGetter.var2){ while(storeGetter.var3){ localvar = await…
Typo
  • 1,875
  • 1
  • 19
  • 32
1
vote
3 answers

How to iterate over solid-js children with typescript annotations

Say I have the following component, how would I iterate over and render each child to do stuff like wrapping each child with other components? interface StuffProps { children: `?` } function Stuff({ children }: StuffProps) { // ? } I've tried…
gxc
  • 4,946
  • 6
  • 37
  • 55