SolidJS

S

SolidJS

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

Join

How to use useSubmission with server action passed to form?

I have a server action that returns data: ```tsx const createItemAction = action(async function (formData) { "use server";...

Struggling with load function and cache revaliation

Hey All, I'm new to solid and am struggling with getting cache revalidation to work with a load function. I've tried to follow the docs as closely as I can, but my load function (and subsequent network request) never seems to get called again. I'm trying to build a basic component that will refetch data filtered based on a selection the user makes: ```...

Basic store example is not reactive

I'm struggling to understand why this code isn't reactive ``` import { createEffect, createMemo, createRoot } from "solid-js/dist/solid.js"; import {...

setStore TypeScript Issue

I have a object store that has an interface like this: ``` export interface config { object1?: type1; object2?: type2;...

Redirect troubles

It's the classic use-case where I want a page to redirect if a user isn't logged in. ```ts // lib/server.ts export const getCurrentUser = cache(async (): Promise<User> => { const event = await getRequestEvent();...

Error: Cannot find cache context

SSR: ```tsx import { cache, createAsync, Route, Router } from "@solidjs/router"; import { Suspense } from "solid-js"; ...

Phosphor icons

Hi Everyone I'm new on Solid JS, and I'm trying to get a cool icon font package. I see that Solid Icons have a lot of icons, but I want to use Phosphor icons. In my case I'm using the web package and import the .css file. I see that exists a package for Solid, but in terms of performance, this usage with the web version is a problem?...

`bun create solid` takes long time to create a new project

I'm using bun to create new project. After running bun create solid and choose with tailwindcss template, the process stuck at the step of Creating Project without any file created in my project folder. Has anyone every come across this issue before?

Is there a convenient way to check the permissions of a user

I wrote it that way, but I don't think it's ideal.
No description

How to route `products/[id]/settings` in Solidstart?

trying to achieve example.com/products/1/settings ``` |--routes/ // example.com |--products/...

(Vinxi)Error while deploying a project generated by Solid Start

I dont think theres a need to share the code as i use pnpm create solid and then chose the basic template just for testing anyways this is my package.json ```{ "name": "example-basic", "type": "module", "scripts": {...

this is undefined

Hello I am trying to create an action with solidstart but i get the following error. Here is my code: ```ts export default function Test() { const test = action(async () => {...
No description

Is the `solid-element` library still being maintained?

I'm working with an engineering team at SuperTokens to create a set of reusable Web Components, and the team was interested in using solid-element to get the job done. However, there doesn't seem to be extensive documentation for this tool, and it hasn't gotten an update for quite some time. Is the recommendation to use something else like lit-html for creating Web Components? And is it safe to assume that solid-element is "Use at your own risk", or will it be getting more attention later?...

Issue with localStorage and signals

Hii sorry to bother y'all but I have been having this problem for 3 days now, so everytime I change the cdg object (changing the gameImage and gameTitle) if I go to dev tools it shows that it changed but later it isn't showing the new gameImage nor gameTitle ```javascript const [currentImage, setCurrentImage] = createSignal('')...

Proper Usage of load() for Authentication and Redirection in Solid-Start

Scenario: When a user tries to access a route that requires authentication, they should be redirected to the login route. After logging in, the user should be redirected back to the originally requested route. To achieve this, I created a function getUserWithQueryPara. This function checks if a session token is saved. If a token exists, it fetches the user information based on the token; if not, it redirects to the login component. To ensure the user is redirected back to the originally requested route after authentication, a query parameter is added to the login route. ...

Different header for specific routes

Hi everyone Maybe it's noob question and sorry for that. It's possible have different layouts for specific routes? For example transparent header and a header with background in certain routes....

Returning Errors and not throwing

I am messing around with actions and useSubmission and I have seen Ryan and the docs mention it is best to return, not throw, Errors
Rather than throwing errors, it is recommended to return them from actions. This helps with the typing of submissions that would be used with useSubmission. This is important when handling progressive enhancement where no JavaScript is present in the client, so that errors can be used declaratively to render the updated page on the server.
Rather than throwing errors, it is recommended to return them from actions. This helps with the typing of submissions that would be used with useSubmission. This is important when handling progressive enhancement where no JavaScript is present in the client, so that errors can be used declaratively to render the updated page on the server.
I dont understand the "so that errors can be used declaratively to render the updated page on the server" part...

With Solid Auth template, I get "UnknownAction: cannot parse action at /api/auth/session"

I am using the Solid Start with Auth template and created a server action form form submission ```tsx import { getSession } from "@solid-mediakit/auth"; import { action } from "@solidjs/router";...

Is this a good method to secure routes?

```javascript <Route path="" component={RequireAuthContextProvider}> <Route path="" component={RequireAdminContextProvider}> <Route path="" component={SystemContextProvider}> <Route path="/system">...