SolidJS

S

SolidJS

Solid is a declarative reactive Javascript library for creating user interfaces.

Join

Can't use import `assert {"type":"json"}``

whenever I try to import a .json document with the assert specified, i get errors about missing babel plugins, but I'm not able to add a babel plugin. Small repro here: https://github.com/birkskyum/solid-import-assertions

Was watching Theo's video and wondered if solid had a good way to do this

https://youtu.be/jYV1VDhw7E8?t=447 It involves saving a state when a components moves position in the DOM. Theo will explain it way better than I ever could...

How to use load property of <Route>

I haven't been able to figure out how to use <Route>'s load function and haven't found a complete example. One property of props in Person has the data from the fetch but it is still a promise. I'm not sure if it should be and if so, what to do with it. index.jsx...

update JSON.stringify when child object updates

Hello, i'm using solidjs in few projects, and I managed to find something I don't really understand how to solve 🙂 https://playground.solidjs.com/anonymous/d153ac69-05b0-4d11-b42c-f0e252b7db5b After one second x.z in appstore is updated ... I would like JSON.stringify to also be updated, how can I achieve this?...

Passing State between different routes

Do you think this is a good idea to pass data between different pages using solid router. class SessionStore { navigate_filter?: string...

Solid Contexts with Astro for authentication

I am writing a reusable context for authenticating with Auth0, and there are two parts to it. Logging in via a button at the nav-bar that is in a separate Astro file that imports the Solid Login button, and another call that gets the token from the same context in another content Astro file that imports the Solid component for getting the token. The two files are then merged into a single page. However, I cannot get the conection between the two working since they are in separate astro files. The only way I could work around it was to not use a context, and globally create a Auth0 client and import it in both files. Is there a better solution? Here's the code...

Issue subscribing to store changes

I am having trouble understanding why the onClick event of my button in this playground code snippet does not update the UI, if you click on the add sub questions button, it will change the underlying data in the store, but none of the UI elements get re rendered, the error messages from solid playground are not helping either, pls help, here is the playground link https://playground.solidjs.com/anonymous/8675c6e7-3b73-4562-a127-16d43d336f76

I have no clue what I am doing wrong

Hello, I am very new to Solid, I am working with stores right now to represent this data structure: ```js const question = { title: String, id: number,...

How can I only set the ref for an element once it's been inserted into the DOM?

I've tried a few things but it doesn't seem like the element is inserted to the DOM at the point where the ref is called, which does make a bit of sense, but I just can't find a proper escape hatch for this. Tried: - Using setTimeout(..., 0) before setting - Checking if document.contains(...) before setting...

Intersection Observer Issues

I'm working on a game and I want some elements to animate in when they become visible, so I'm using intersection observers. I came up with this solution, and it works perfectly on firefox, but it sometimes bugs out on chrome. Sometimes the elements don't appear, and the screens stays like on pic related. Here's the relevant code ```javascript //get_observer.ts export default function get_observer(...
No description

what write so as not to constantly write a redirect in every function in case of unauthorize

I don’t have a database on the solidstart server, I only work with third-party APIs. Where to store user information. I want not to write in some functions constantly the same code for processing unauthorized. You need to write a wrapper function?...

Solid doesn't re-render when update the same array in createSignal

Expected behavior: Re-render inputs every time passwords array is updated even with the same value, to avoid duplicating value in the same input. ```tsx import { Component, For, createSignal } from 'solid-js'...

For some reason <select> doesn't work correctly

https://playground.solidjs.com/anonymous/eedf65f3-e52b-49b0-a8b2-513465a75666 Here it is. When changing the select the value changes but there's no visible change of it's option...

Can someone tell me how to redirect the user on each API, if 401, that is, do not write the logic ag

Can someone tell me how to redirect the user on each API, if 401, that is, do not write the logic again for each action

How to use web component in solidjs

Please ask solidjs how to solve the use of web component component editor ts reported error Property my-component does not exist on type JSX.IntrinsicElements
No description

How do I debug updates

I thought My app is working fine except I noticed a lag, which performance profile shows lots of unnecessary updates happening, how do I make sure I can detect all of these and they don't happen. go undetected.

How to detect button holding in solid js?

Does anyone know how to detect a button being holding for 2 seconds and are there any libraries or built-in functions for holding gesture?

Vite internal server error expected "}" but found end of file

see screenshot, this is not the end of the file (not even close)
No description

How do I "curry" a function with props?

I have a method "colorize" that receives two arguments: hue and shade. A component has a props.hue and I want to curry that function. I can't do it with createMemo since the accessor does not receive a parameter. How would you do it? ``` function colorize(hue, shade) { ... } ...

MobX + SolidJS enableExternalSource untracked bug?

I am evaluating using MobX with SolidJS and now that there is an untrack parameter to enableExternalSource I have tried putting MobX's untracked in it, but I'm running into an issue with <For> updates Please see: https://github.com/solidjs/solid/issues/1850#issuecomment-1976086047...