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
0
votes
2 answers

Reseting a store object to a default value in SolidJS

How would you completely reset a value in a store in SolidJS I have something akin to: interface Item { id: number, price: number, quantity: number } ​interface State { items: Array } export const ItemsContext = createContext() export const…
AuSaidimu
  • 89
  • 7
0
votes
1 answer

How to calculate forces to be applied to the player on separate createEffect's that resets on each update

I have a counter, that I want to accumulate some numbers by adding to it. On each update it resets to 0. I wanted to separate these updates into separate createEffect. But it doesn't work. How should I change my logic, so the player goes smoothly…
eguneys
  • 6,028
  • 7
  • 31
  • 63
0
votes
0 answers

createEffect logs reactive updated signal, though dom is not updated with the reactive property

I think this time I've reproduced my issue here. I am using this create_delayed function from previous question, now the createEffect in elevate function logs the updated value as 101. But it's not updated on the dom result. import { render } from…
eguneys
  • 6,028
  • 7
  • 31
  • 63
0
votes
1 answer

How to animate translate between elements of two arrays

function Counter() { const [list1, setList1] = createSignal([1, 2, 3, 4, 5]); const [list2, setList2] = createSignal([6, 7, 8, 9, 10]); setTimeout(() => { setList1([1, 2, 3, 4, 5, 8, 9, 10]) setList2([6, 7]) }, 1000) return…
eguneys
  • 6,028
  • 7
  • 31
  • 63
0
votes
1 answer

how do I make granular signals that works for properties of a whole pure class

I have a class that keeps input events and lets me query the state. class Input { btn() { return this._btn } _release() { this._btn = -1 } _press() { this._btn = 0 } listen() { document.addEventListener('keydown', e =>…
eguneys
  • 6,028
  • 7
  • 31
  • 63
0
votes
1 answer

Parcel fails to resolve 'solid-js/jsx-runtime' for TSX files

I'm migrating a React Webpack project into a SolidJS Parcel project. However, the combination of SolidJS and Parcel seems to have problems with nested Typescript projects, which combinations of React and Webpack do not have. In my minimal example…
Martin
  • 598
  • 1
  • 4
  • 27
0
votes
1 answer

TS - Reusable API request hook - type not assignable to type 'IUseApiHook'

What I am trying to do? I want to create a function that can make any type of API request for a frontend application. Basically, I want to get fancy. Problem? I am in over my head and I need another eye to take a look at my broken approach. Here is…
Radu Gafita
  • 51
  • 2
  • 4
-1
votes
0 answers

Solidjs make SVG element draggable

I'm working on making an image mask where you can drag the elements around to reveal the part of the image that the element covers. It's fairly easy to make a mask like this with SVG as seen below:
-1
votes
1 answer

Where is the subscribe function coming from in the SolidJS docs?

I have checked thoroughly and found that SolidJS does not have an observable where one can subscribe to store reactive primitives, only signals as far as I know. What is the observable used here if that is the case? const unsubscribe =…
-1
votes
0 answers

Smart Contract Deployed functions return undefined

The error says "app.js:152 Uncaught TypeError: Cannot read properties of undefined (reading 'deployed') at Object.submitPatientInfo (app.js:152:37) at HTMLButtonElement.onclick (patientDashboard.html:47:69)" The contract was deployed when i signed…
-1
votes
0 answers

Classy-solid and nested createEffect observations

Considering moving to SolidJS. I really like its simplicity. I like the createMutable, too, as it means I can pass single items around and eliminate a lot of set/get code. Finally, I prefer classes, and having classes own/update their own state,…
EJHewy
  • 564
  • 4
  • 7
-1
votes
1 answer

redo function of solid-record does not properly set state

I am using solid-record to build a mind mapping application. The data in the application is a tree of nodes, and I want the ability to reparent a node, with undo/redo. The issue I am facing is that even though the undoing operation works fine, the…
Franck Dervaux
  • 121
  • 2
  • 12
-1
votes
1 answer

how to create an Autocomplete element?

I'm looking for the Autocomplete element of Material UI and React for SolidJS. Many of the elements are available in Solid through https://suid.io/, but https://mui.com/material-ui/react-autocomplete/ seems to be missing. Is there any library…
vjalle
  • 549
  • 4
  • 13
-1
votes
1 answer

Is Context good for dependency injection of services in SolidJS?

I'm just getting started with SolidJs and am learning about Context. It seems like this might be a good way to inject singleton services throughout my application, some of which might be reactive. Is that an appropriate use? For example, I might…
JustinM
  • 913
  • 9
  • 24
-1
votes
1 answer

Alternative to mapArray that waits on a promise when removing an item

I don't want to use transition-group or any superfluous code. I just want the below API style to work. The output after 1 second is a a 3 4 5 6 The output after 2 second becomes 3 4 5 6 import { render } from "solid-js/web"; import { For,…
eguneys
  • 6,028
  • 7
  • 31
  • 63
1 2 3
16
17