SolidJS

S

SolidJS

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

Join

Small preload script after document load but before page load

I'm trying to port the theme toggle from tailwindcss.com to Solid.js. I'm getting stuck at this part. The following script: ```js try { if (localStorage.theme === "dark" || (!("theme" in localStorage) && window.matchMedia("(prefers-color-scheme: dark)").matches)) { document.documentElement.classList.add("dark");...

Creating custom signal.

I just made a simple custom signal. But is this still reactive? I know there is createMutable. but it seems it's discourage to use. So Can I use my own like this?...

How does height of the body work in Solid Playground?

This may just be a lack of understanding of CSS but in my defense, CSS is hard. Here is the link to the component I'm prototyping in the playground: https://playground.solidjs.com/anonymous/962a237f-cfbd-4a77-bc7f-f2034bdbd5fa. What I'm wondering is why my Open Modal button is centered on the height of the window without considering the console whereas the actual modal is centered in the viewable space accounting for the console. The button is centered in a flexc container with a height of 100vh whereas the modal is centered with position: absolute, top: '50%', left: '50%', transform: 'translate(-50%, -50%)'. Is this a specific behavior of the solid playground or is this a CSS specific thing with heights that I don't understand?...

Is solid-realworld example really real world?

I'm trying to follow the pattern solid-realworld uses. But the state management is really confusing me. Other made a same question like me. https://github.com/solidjs/solid-realworld/issues/20 It's even not typescript. Where can I see true real world example?...

Theme management with Solid

I would like to have a Dark and Light Mode on my page. For this I use Solid in combination with Astro. ```html <html> <!-- index.astro --> <body>...

Will we see solid-native?

I really love Solid. I want to make iOS / Android / Desktop app using solid.....

How to clear solid-primitives's storage?

I'm trying to use solid primitives's storage. How to clear localStorage ? I know can call window.localStorage.clear () But it's not reactive....

useSearchParams not working

Even though there is ?hey=hey search param, the proxy object is empty

stop and then restart makeIntersectionObserver on window height change

I'm switching from the Javascript intersectionObserver to solid's primitive for it because someone mentioned I shouldn't be using imperative code in a declarative framework like solid 🙂 Before I was using
`elements.forEach((element) =>...

Access dynamic route params in components outside of the FileRouter

In this structure: ``` <Body class="h-full bg-slate-900 text-slate-300"> <ErrorBoundary>...

classList not working on icons svg

```js import { IoCloseOutline } from 'solid-icons/io' <li class="text-dark flex items-center border-2 rounded-full w-auto">...

useParams not working

hey, I wanted to have my fetch functions for resources in separate file but when I use useParams inside of the fetch function it works just fine the first time but if I switch to different route it returns a proxy object with no params in my layout its not detecting the params even though its there SidePanel.jsx:...

SolidStart - Can't use 'os' module.

I just created solid-start project, Then I want to print 'os' homeDir in app. But I see this error. Error: Module "os" has been externalized for browser compatibility. Cannot access "os.homedir" in client code....

Solid Playground error in style tags

I am getting a weird error when using style tags in the solid playground. https://playground.solidjs.com/anonymous/99ed027e-f5e6-4861-9608-2de8b21acccf It feels like a bug because the styles are still applied correctly, its just showing an error in the editor....

How to change child child value?

https://stackblitz.com/edit/github-gp2gff?file=src%2FApp.tsx I'm trying to make some kind of parser, but I don't know how to fix this problem. Any help?...

Please remove Portal's div wrapper...

I don't understand why <Portal> wrap my component in new div... Is there no way to remove it??...

Keep 'DEV' in production-mode

I would like to make use of the $NAME-symbol from solid-js/store (for my experimentations at https://github.com/bigmistqke/solid-yjs-store, so i can allow multiple store-paths leading to the same reactive value). this is currently only exported as part of DEV afaik. Is there a way how to keep DEV available when doing a production-build?

setting getter in store on already defined key loses reactivity

```const [store, setStore] = createStore({ value: 0, alreadyDefinedKey: {}}); setStore('newKey', { get get() { return store.value...

Can I change the requested URL in a middleware?

I created a page middleware, and I'd like to update the requested URL from foo/bar to bim/bam/boum in the event object? Here's my skeleton code: ```ts export const useBackendPathResolver = ({ forward }: MiddlewareInput) => { return async (event: FetchEvent) => {...

How to set a cookie when using `createRouteData` or `createServerData$`?

For user authentication it may be necessary to set a cookie. In Remix, for example, it is solved so that a loader can either directly return a value or alternatively a Response. The Response can then be used to set the Set-Cookie header. Remix seems to recognize whether the values are returned directly or via a Response, e.g. with json({...}), and interprets the types correctly when calling useLoaderData<typeof loader>(). This does not seem to work with SolidStart. Is there an alte...