SolidJS

S

SolidJS

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

Join

Async Primitive

Hi I'm a bit stuck, you know that primitive is asynchronous and can be used in a following case. there's the createResource primitive, but I can't see how to use it properly, especially as I'd like to be able to put the files in indexedDB. ```js let images: Promise<{ items: ImageType[]; }> | undefined;...

`createMutable` fails Vitest's `toStrictEqual` when `vite-plugin-solid` is active

When the vite-plugin-solid plugin is not enabled, the following test passes:
expect(createMutable([1,2,3])).toStrictEqual([1,2,3]);
expect(createMutable([1,2,3])).toStrictEqual([1,2,3]);
...

Render Portal as Error Boundary Fallback?

I want to refactor my async code to use Suspense and Error Boundaries. But when a network request fails... I show an error dialog telling the user what happened and what to do next. This is rendered in a Portal. Can I just stick that component in the fallback of an Error Boundary and have it work the same?...

events not fired inside react modal

I can't provide a small reproduction, I tried but I couldn't. I have a react project with reactstrap, and I'm using their standard Modal component. Inside of it, I'm mounting a Solid app ( I already have other Solid apps working normally inside of React but outside of the modal )....

How to decorators typescript signal

To template this out ``` _foo: Signal<number> get foo() {...

How to avoid passing props all over the place

How cool is putting all your interface in a massive pile of one closure to avoid passing stuff around. Except maybe some reusable components. Markup content deeply nested in show when clauses.

Does streaming work in SolidJS with signals?

Hello! I was trying to update my OpenAI Assistant to use the new streaming API and I can successfully get it to work and log to the console, but when I update a signal instead of console.loging...the UI never updates after the first item? I'm guessing there is something on the "fine-grain" reactivity playing a part of this? I'm new to API streaming but would love to add this feature to my app and be more performant (also have a cleaner codebase)? Anything I'm missing?...

Route definition within a component

I can't figure out if I can add routes within a component. I've created a simple app where I have a bulma panel with tabs, and trying to route the navigation of each tab to a different component, but can't figure out how to setup the routing. This is with the latest version of solid and solid-router. I am attaching a zip with the key files here. If someone can help me figure this out I'd be appreciative. When I use this code clicking on each tab results in the Page Not Found route from App being triggered ...

Need help with running solid-community/solid-primitives

- clone solid-community/solid-primitives - pnpm install - pnpm run dev - throws something like "packages not found, did you forget to run pnpm run generate?" - in /site run pnpm run generate...
No description

How to build styled Web Component with a CSS library?

Solid's solid-element is great for building Web Components. Styles inlined on components work just fine. However, when the component starts getting complex, it's helpful to make use of some sort of CSS library. When building with Vite, many of the CSS libraries output CSS files or inject code that injects the styles in the DOM (which don't penetrate the shadow DOM boundary). What's the best way to handle styles when building a Web Component with Solid?...

Using SolidJS's produce(), but with Immer-style patch generation?

Is it possible to use SolidJS's produce, but with patch generation akin to Immer's produceWithPatches? (being able to only store the delta (patches), as well as supporting things like classes) I'm currently using a combination of Immer's produceWithPatches and reconcile to work with a state that's made up of nested instances of various classes. The only reason I'm using Immer in the first place is to get the undo/redo functionality with little fuss, but it doesn't play well with SolidJS, and is slow and results in unnecessary re-renders....

Cookie bug

https://github.com/sh1man999/solidstart-auth.git The problem is the following: After I called logInAction, I set cookies and redirected to the main page, but the redirect did not occur...

Why is `BoundEventHandler` typed this way?

The type for BoundEventHander is, ```ts interface BoundEventHandler<T, E extends Event> { 0: (...

How can you get the id of element body when its id is changed?

How can you get the id of body element when changing its id, is there any hooks or something like that?

Is anyone detecting light vs dark mode on their site>

For example, I frequently use
const isMobileSize = useMediaQuery("(max-width:600px)");
const isMobileSize = useMediaQuery("(max-width:600px)");
...

how to end response without using "nativeEvent"?

what would be a better way of writing the following inside of middleware? ```javascript  event.nativeEvent.res.writeHead(403).end();  return;...

what's the difference between? createResource andcreateAsync

and who can write about createAsync in more detail essentially createAsync is a wrapper over createResource, but I don’t remember what it’s for? and why do you need to indicate on the routes export const route = {...

How to create a reactive localstorage?

Hi, I need to create a reactive localstorage for localization on my site but I don't know how to do it, here is my attempt to make one: ```js const [locale, setLocale] = createStore({ locale: "en",...

How do i make a list properly reactive to state changes?

So I have this for loops that iterates in an array of data fetched on page load, i devided the sorting functions in 2 categories checkerFunctions that check a checkbox value, and filterFunctions that check a object value in a signal. The filterFunctions steps works just fine, but i don't know why the checkFunctions don't. Am i assigning a bool wrongfully? ...

SolidStart - Create T3 Equivalent

Is there any stack like create t3 app but for SolidStart? Also what component library y’all using?