SolidJS

S

SolidJS

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

Join

updating nested object not triggering update

Heya I'm fairly new to SolidJS (You might have already seen some of my previous post of me strugglin' :D) I'm trying to update the state of a nested object in a store but it doesn't seem to trigger an update on my component. here is the method I use to update (it's declared in a context provider) ...

Build timeout with Gitlab Runner

Hello team, I have a problem with building a SolidStart application with Gitlab Runner. I hope someone can help 🥹 Problem: it's timeout when using Gitlab Runner (1st photo). The job takes more than 1 hour and is automatically canceled. Context: - Last week, it worked database1orange but not for now. I think some dependencies are updated and have bugs bug1purple . I tried to use a fixed version of dependencies as last week & my laptop (2nd photo) but still did not work....

Solid newbie

I apologize, for this is really a noob question but i have been stumped for a bit, so i guess i'll ask: How do you separate backend and frontend functions in solid? All tutorials and resources I have seen are frontend only or use backend as a service for their apps. I would like to use node.js to build an app. Is this usually done with HTTP requests? Am I missing the point of solidjs? I like the ease of use and speed that comes with solid as someone who wrote their first app with plain javascript and express, but it seems the lines have been blurred now that I want to use a framework....

UI isn't updating properly depending on the context provider's state

hi, my UI isn't updating properly depending on the context provider's state

How to do nested <For

I have a signal that is array of arrays ```js const [grid, setGrid] = createSignal([ [1, 1, 1, 1, 1, 1, 1, 1],...

Is there a way to make an iframe reactively render with state/signals from its parent?

Stuff that I tried: - Set state/setState in the iframe.window.someGlobal and access it in the iframe from there - Wrap createState in createRoot - Render the iframe solid app with runWithOwner with the owner of the parent app ...

Forward reference a Component's state in Template

I try to wrap a Trigger and a Display component in a state managing component like so ``` export function Wrapper(props) { const [state, setState] = createSignal(false)...

Child component cannot access context that the parent can access?

I have a file like this: ```tsx import { useLexicalComposerContext } from "./LexicalComposerContext"; import { useLexicalEditable } from "./useLexicalEditable"; import { useCanShowPlaceholder } from "./shared/useCanShowPlaceholder";...

How do I scroll to bottom, on a scrollable content that displays a Show when

<div ref={$content} Show when={signal()} ``` createEffect(() => { set_signal(true)...

Solid JS force rerender on signal change

I need to force Solid JS to make changes to the DOM every time a signal changes. Currently it seems that it is batched, probably for performance reasons. I can get around this by wrapping my second signal change in a setTimeout, but I want to make sure I am not implementing a hacky solution. For example, could I reliably get away with using a requestAnimationFrame or is there some Solid JS provided function that I missed? Here is a code snippet that demonstrates the problem and the timeout fix. If you remove the setTimeout, you will see no change. ```...

Subscribe to data in solid-start

I'm using Supabase with solid-start. I'm pulling data from the postgres db using createServerData$ function. I'm hoping to have this page subscribe to the data and update if another user inserts data to the postgres table. Are there any patterns to handle this using solid-start? I'm not sure how to subscribe in an SSR setting....

Generate random numbers serverside and don't regenerate on hydration

I'm trying to generate a list of random numbers for a skeleton loader, and I've found a solution, but it does not feel like the right way to do this. ```tsx const [randomsResource] = createResource(() => [""], { initialValue: [...

How can we lazy load route data using @solidjs/router ?

When using this pattern: ```javascript import UserData from "./pages/users/[id].data.js"; const User = lazy(() => import("/pages/users/[id].js"));...

Context In Typescript

I'm trying to create a context in Typescript following this example, but copying and pasting the code results in an error when I try and use the ThemeContext.Provider in the ThemeProvider Component. https://www.solidjs.com/examples/context Cannot find namespace 'ThemeContext'....

Vercel + Prisma

Hopefully someone here can help with my issue, but I'm trying to use Prisma with solid + vercel, however I'm getting an error that "no such file or directory, open '/var/task/schema.prisma'". The issue is, that file should exist. I have other projects on vercel with solid + prisma which work fine, and I have absolutely no idea what is wrong with this one. My package.json includes a vercel-build with "prisma generate && solid-start build && cp node_modules/.pnpm/**/@prisma/engines/*query* .vercel/output/functions/render.func/ && cp prisma/schema.prisma .vercel/output/functions/render.func/" (To copy over the prisma engine/schema into the render function), however the error still appears, even though I am sure the files do get copied....

Server rendering error on createResource. Inconsistent HMR.

I am currently get this error when calling npm run dev and npm run build just hangs. ```bash GET http://localhost:3000/ An unhandled error occured: TypeError: Cannot read properties of undefined (reading 'id') at Proxy.createResource (/Users/rexor/projects/fastsearch/solid/node_modules/solid-js/dist/server.cjs:412:35)...

Set Timeout Example

I want to update a single every x seconds in a component. Are there any examples of this I can look at? Right now this is my approach, but it is not working. I can't seem to find any examples anywhere. ``` import { render } from "solid-js/web"; import { createSignal, onMount } from "solid-js";...

How to make an Isomorphic Component Library?

What's the proper way to deploy a SolidJS component library with isomorphic rendering?

How to access browser language during SSR?

In an SPA you would normally access navigator.language but during SSR the navigator is undefined. How can I access the browser language/locale during SSR?