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

parcel serve works but parcel build does not

I'm setting up a new project with Parcel, TypeScript, and SolidJS. With the exception of TypeScript, I'm fairly new to this tech stack. I've gotten the ts and tsx targets building exactly the way I want, but the html file is giving me a…
p.s.w.g
  • 146,324
  • 30
  • 291
  • 331
3
votes
1 answer

Does Solid JS have an equivalent of React.useCallback?

Solid has createMemo which I thought might work, but it says "The memo function should not change other signals by calling setters (it should be "pure").", which is not suitable for my use case.
abc
  • 1,141
  • 12
  • 29
3
votes
1 answer

SolidJS: Typescript error says value is of type 'undefined' despite checking that it isn't

I have some SolidJS code like: {value() !== undefined && } where value is a signal. I get a TypeScript error under value() saying Type 'undefined' cannot be used as an index type.ts(2538) What does this mean and how do I…
abc
  • 1,141
  • 12
  • 29
3
votes
3 answers

How to update local storage values in SolidJS using hooks

I'm trying to make a custom "hook" for solid-js that will retrieve state from local storage. import { Accessor, createSignal, Setter } from "solid-js"; export default function createLocalStorageSignal(key: string): [get:…
Zachiah
  • 1,750
  • 7
  • 28
2
votes
1 answer

Can signals be built on top of observables?

I read that signals are different from observables. But could one be used to implement the other? For example, could one implement Solid.js createSignal using the TC39 proposal? Would that be more efficient if it's native? Would it be even better to…
llllvvuu
  • 286
  • 1
  • 9
2
votes
0 answers

Loading data from server with SolidStart doesn't work as it should be for me

This is my first try on building a web app, so there might be an obvious answer but I have been struggling for some hours now. Thank you in advance. This is the code for the page this is about: import { createServerData$ } from…
MetaphysX
  • 21
  • 1
2
votes
2 answers

How to prevent re-rendering when switching the pages in SolidJS?

I'm struggling with the re-rendering issue in the SolidJS application. I have two routes, Home and Detail. A user can explore items in Home, and click the link on the item name to switch a page to Detail to check out detailed information. export…
Simon Park
  • 694
  • 1
  • 7
  • 18
2
votes
1 answer

Why to use Context and Provider given SolidJS reactivity?

I have this SPA project which authenticates and authorizes its users via access tokens (JWT). These short-lived access tokens has their refresh tokens as well, so when they expire the app should refresh the access token and replay the failing…
ozanmuyes
  • 721
  • 12
  • 26
2
votes
2 answers

SolidJS: "Unrecognized value"

I am able to receive the JSON value from the API path just fine. Flask Code app = Flask(__name__) CORS(app) @app.route("/cats-matches", methods=['POST']) def cats_matches(): person = {"name": "John"} #Does not work #person = [{"name":…
ccraig
  • 931
  • 1
  • 6
  • 7
2
votes
2 answers

Why can't I show my solid-js button using the conditional method after I assign a value to my variable?

I work in solid-js. I created in my project a url variable. My application must display a chat creation button to the user if the value does not the url variable exists and a message You cannot create a whelpschat if the variable has a null value.…
Goune Kenfack
  • 107
  • 1
  • 7
2
votes
2 answers

How to add multiple events handlers to Solid.js components on the same HTML element?

Overview I'm new to Solid.js and am looking for a way to add multiple event handlers to the same HTML element from different components in JSX. This is simple to do in Vue but it appears that events are overridden in Solid.js depending on how the…
doseofted
  • 77
  • 2
  • 7
2
votes
3 answers

How to use SolidJS's tag with Typescript

I have the following code inside a SolidJS component {props.hint} It works as expected, however, typescript keeps saying that rather than a string props.hint could also be undefined. I…
Felipe Chernicharo
  • 3,619
  • 2
  • 24
  • 32
2
votes
2 answers

Solidjs router does not render

I already searched a lot and could not find an answer. In my SolidJs app, the second route is not redered in root element: import { Routes, Route, useLocation } from "solid-app-router" import { useNavigate } from 'solid-app-router'; const Login =…
Richard Feliciano
  • 115
  • 1
  • 1
  • 9
2
votes
0 answers

SolidJS Create Resource - Uncaught Error in Promise

I'm new to SolidJS and I'm having a weird error with resources. Here is my code: export const authUserResource = createResource( () => axios.get('/expense-tracker/api/oauth/user').then((res) => res.data) ); export const MyComponent =…
craigmiller160
  • 5,751
  • 9
  • 41
  • 75
2
votes
1 answer

In SolidJS, How Do I Do a Fallback Route?

I'm new to Solid JS, coming mainly from a React background. I'm using Solid and Solid-App-Router right now for the first time. I'm trying to design routes with a fallback, meaning if an endpoint is put into the URL that does not exist, it will…
craigmiller160
  • 5,751
  • 9
  • 41
  • 75
1 2
3
16 17