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
2
votes
1 answer

SolidJS - how to get the current component instance

Is there a way to access the instance / get a reference of the Component that it is currently rendered/active in SolidJS, an thus its current props, signals, internal state, effects etc.? I am looking for something like React's…
Aÿlo
  • 271
  • 3
  • 7
2
votes
1 answer

Passing directive as props

For example I have a simple directive like this: export const inputLogger = (el: HTMLInputElement) => { const onInput = (e: Event) => { console.log((e.currentTarget as HTMLInputElement).value) } el.addEventListener("input",…
Owl
  • 6,337
  • 3
  • 16
  • 30
2
votes
1 answer

run createEffect only for specific setSignal which fires on user interaction

I am trying to build a text editor, where _cursor is position of the cursor. setInterval 4000 seconds is like user moving the cursor. In which case I want to run an effect. But often I set the cursor as a side effect internally, for example when…
eguneys
  • 6,028
  • 7
  • 31
  • 63
2
votes
2 answers

Solid.js: How to put useContext within a provider coming from an external event

const CounterContext = createContext(); export function CounterProvider(props) { const [count, setCount] = createSignal(0), store = [ count ]; return ( {props.children} …
eguneys
  • 6,028
  • 7
  • 31
  • 63
2
votes
1 answer

Solid JS with Typescript - "as" prop \ "component" prop

So I'm trying to do the following thing with solid-js. But can't figure out the right way with typescript. I want to modulate my styling through my components. type RelevantTags = Exclude
Asaf
  • 21
  • 1
1
vote
0 answers

TanStackTable - Solid: How do I use a Solid Store as the data source?

I have a table component that invokes createSolidTable with the following code: type TableProps = Omit, 'children'> & { data: T[] ref?: HTMLTableElement columns: ColumnDef[] pageSize?:…
1
vote
1 answer

How do I modify a member of an object in an array in a SolidJS Store using the SetStoreFunction, and have corresponding views automatically update?

I'm trying to modify an element of a SolidJS store using the SetStoreFunction (setExpressions), so that the View for the store's values are updated, e.g. when text is entered into a text field. I originally thought the problem had to do with calling…
1
vote
1 answer

How to convert a SolidJS Resource into a javascript array that can be filtered?

My SolidJS component fetches a JSON object from a server. I can use the SolidJS For loop to process the result, but I cannot use the vanilla javascript filter function. function YearSearch(props) { const [years] = createResource(() =>…
1
vote
1 answer

Solid.js keep complaining about missing React when it shouldnt

I keep having this issue that Solid.js says "React is not defined" when the package being used dosent rely on React? I had the issue with Solid-spinner and solid-query. Uncaught (in promise) ReferenceError: React is not defined at TailSpin…
Ole Dybedokken
  • 343
  • 2
  • 15
1
vote
0 answers

solidjs provider not working when using children helper method

I have a theme provider written like this import { Accessor, JSXElement, Setter, children, createContext, createEffect, createSignal, onMount, useContext } from "solid-js"; import constants from "@/constants"; type TThemeProviderProps = { …
Adharsh M
  • 2,961
  • 3
  • 16
  • 23
1
vote
1 answer

What is the meaning and significance of starting function names with use and create for SolidJs

I am trying to start a side project with SolidStart and I noticed some functions are named the same way a React hook would be named (eg: useLocation, useParams, etc...) I am confused by this somewhat since I see many functions that are the analogs…
kaan_a
  • 3,503
  • 1
  • 28
  • 52
1
vote
1 answer

SolidJS effect not triggered on related element

I am trying to build a mind mapping application using SolidJS. It shows 'nodes' with content that are organised in a tree, and the application automatically lays the nodes out in a tree-like display. To perform this layouting, the application must…
Franck Dervaux
  • 121
  • 2
  • 12
1
vote
1 answer

How to integrate solidjs and django

I want to set up a web application which in backend uses django and in front end uses solidjs. In the development phase how do I integrate solidjs into django? I have a directory called project which contains directory called: back (django-admin…
problème0123
  • 841
  • 2
  • 9
  • 23
1
vote
1 answer

SolidJS: Why does index re-render when value is changed without changing index?

I don't understand differences between For and Index, I read the following question. SolidJS: For vs Index I changed the code a little bit and execute in the playground. import { render } from 'solid-js/web'; import { createSignal, For, Index } from…
seongkuk han
  • 570
  • 6
  • 14
1
vote
2 answers

"404: not found" error on SolidJS project deployed to Vercel

I recently created a personal website using SolidJS, with server side rendering and typescript enabled. I attempted to deploy this site to Vercel, with the only change from the base Vercel settings being that I changed the Output Directory to…