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

createMemo stops updating after createResource throws an error

When createResource throws, a createMemo that depends on createResource stops updating after further interaction. This examples shows the case, when input 3 it throws. Now How do I recover so further queries will update the m_id as usual. I suspect…
eguneys
  • 6,028
  • 7
  • 31
  • 63
1
vote
1 answer

Array of JSX Elements not rendering on second loop

I have a Solid.js code that looks like this: import { render, For } from "solid-js/web"; const Text = () =>
Example
; const App = () => { const elements = [, , ]; return (
Owl
  • 6,337
  • 3
  • 16
  • 30
1
vote
0 answers

Passing Props in SolidJS

I came across something weird while trying to pass props in SolidJS. I've created a store using createStore which I pass through the component tree using Context.Provider. I also have the helper function useStore which lets me access the store…
Rahat
  • 305
  • 1
  • 4
  • 10
1
vote
1 answer

SolidJS: Updating signal from within IntersectionObserver Callback

The following is a code snippet from a solid.js application. I am attempting to update the state of a top-level signal from within an IntersectionObserver's callback. The state is being updated within the scope of the callback, but not…
1
vote
1 answer

How to sort the array to display with forEach with createMemo mapArray to display dragged items on top

I am trying to display a list where dragged item is on top. I sorted the list thats nested inside createMemo mapArray. It works in my case, but I couldn't reproduce it with this example. #1 Problem, why doesnt this example sort and display the…
eguneys
  • 6,028
  • 7
  • 31
  • 63
1
vote
1 answer

How to create a signal that delays the underlying signal and clears immediately

I want to make a signal that sets itself to underlying signal or a memo after a certain delay, and clears immediately if the underlying signal is cleared. The following code demonstrates what I want. import { render } from "solid-js/web"; import {…
eguneys
  • 6,028
  • 7
  • 31
  • 63
1
vote
2 answers

How can I position a span that depends on it's getBoundingClientRect with some calculations

I want something like this: const App = () => { let [bounds, setBounds] = createSignal() let $piano onMount(() => { setBounds($piano.getBoundingClientRect()) let key_xys = createMemo(() => { let _bounds = bounds() if…
eguneys
  • 6,028
  • 7
  • 31
  • 63
1
vote
1 answer

What is the third parameter in SolidJSs createEffect function for?

just started playing around with SolidJS and taking a look at the createEffect function. export function createEffect( fn: (v: T) => T, value?: T, options?: { name?: string } ): void; I'm wondering what the third parameter is for and if I…
DavidDomain
  • 14,976
  • 4
  • 42
  • 50
1
vote
2 answers

Setup issue on Webpack and Typescript(ts-loader)

Trying to setup SolidJS with Webpack and ts-loader. Keep getting an issue on return functions. What exactly am i missing in the loader to solve the issue ? import { render } from "solid-js/web"; const App = () => { // return "Hello World" …
7urkm3n
  • 6,054
  • 4
  • 29
  • 46
0
votes
1 answer

Using a component and passing down a signal doesn't cause re-render

I've currently got a component to make life easier when making selects. My issue however is that whenever I reference a signal, it doesn't rerender that component when I'm setting it in createEffect. Below is the Select component: interface…
William Pfaffe
  • 305
  • 4
  • 16
0
votes
1 answer

Solid.js textarea: detect key or access native keyboard event

Consider this snippet (playground):