SolidJS

S

SolidJS

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

Join

How to create and test a data fetching library?

Hello everyone, I am working on a SolidJS integration for GQty. PR#1758 is the current WIP, I am probably doing a lot of things wrong. There are two areas about Suspense where I would really love some help to learn from the perspective of a library author. 1. Triggering Suspense...

AOS alternative

Hi everyone Any package to something like AOS: https://github.com/michalsnik/aos/tree/v2 in SolidJS/Solid Start? I'm not good with animations and AOS is very simple. Can anyone suggest me a package for do this please?...

<A> Component: #id Breaking Link

I'm building a docs page for a project I'm working on. If I create a link with a fragement id pointed to a div on the same page, everything works as expected. The page scrolls to the element with the appropriate id. ```typescript...

Component with only <For /> in it removes all HTML children

I have this set up: ```tsx return <div ref={mapElement} >...

How can I use a custom hook with createMemo in many places?

I have created a hook like this: ```ts // This is a hook const useInMultiplePlaces =() => { ...

Image optimization & createAsync saying that can be null

Hi everyone I have two questions: - I need to create a image componente that at the begin loads a small and blurred image, but after the load completes show the full quality image. I try an example using IntersectionObserver, but at the begining the image doesn't appear. - The second one is with createAsync where: ```ts...
No description

Why this modal reactivity is not working? 60 lines of code

```js import { createSignal } from "solid-js"; import Modal from "./Modal"; function App() {...

How can I publish to github pages?

Anyone know how I can publish my solid-start project to github pages?

Resource state never updates when consumed by <Show>

https://playground.solidjs.com/anonymous/d47ac50e-b5d4-4b1c-8cff-d2c8ed7e1199 Refetch the resource until it fails to make a joke, observe that the joke.state never updates afterward. Is this a bug?...

Wait on (async) onMount from Parent before running (sync) onMount from Children?

Hey! Let's assume you have a component that functions as a global store provider to all children. It sits atop all components. Like so:...

undefined on contexts that depend on each other

how can i fix this conflict? SavedProvider depends on useJsonData, and JsonDataProvider depends on useSaved. ```ts export const [JsonDataProvider, useJsonData] = createContextProvider(() => { // get the state synchronously const [filePath, setFilePath] = useFilePath()!;...

How can i run some dom manip before rendering?

Hello I want to run some javascript that will change classes of the body tag before display. How can I do this?

createResource blocks navigation

I expect that I'm doing something against Solid rules, but I have no idea no to approach the debug. It seems like createResoure is blocking the UI change till the Promise resolves. ```ts export const SingleExchange = () => { const _exchange = useExchangeFromParams()...

SolidJS routing not working, needs to reload the page.

Whenever I try to go to another page I have to reload the page. I use Tauri, SolidJS and vite. sidebar.jsx ```jsx...

Why do Components in For get recreated on any change

Hi, I have this timeline component, and it gets for some reason rerendered on any change to cachedTimeline even if it is data not relevant: https://gist.github.com/MTRNord/26ea26b963e453c2a2812e3f95cba41e#file-timeline-tsx This means the images in the TextEvent flash on each rerender. The TextEvent is defined as: https://gist.github.com/MTRNord/26ea26b963e453c2a2812e3f95cba41e#file-textevent-tsx...

err::insecure_response: solid-start `service-worker` with 'vite-plugin-pwa'

I'm trying to use service-worker and background-sync-api for periodic data fetching with solidj-start and vite-pwa. Static and service-worker both preset builds ok, but localhost = service worker registers ☑️ https://domain.com = service worker registers 🛑 with err::insecure_response...

Button to API route returns 404 but direct hit functions

I think I am running into an issue with the router and im 99% sure there is something I am missing. Im building out an oauth flow. I am able to get the access_token stored as a cookie. I am building the logout flow which is a SolidStart API route that accepts a GET request and just deletes the cookie. Hitting the api route with httpie or via curl returns a 302 to the home page as expected but the button that is a href to the same route returns a 404. I am at a loss why the API route can be hit from httpie, works if I manually go to localhost:3000/auth/logout, but not from the button. I can copy and paste the link the button has and it works, just not when I actually press the button. ...

How can I persist state across page refreshes?

export const [fourCountryQuestion, setFourCountryQuestion] = createStore(getRandomQuestionData())
export const [fourCountryQuestion, setFourCountryQuestion] = createStore(getRandomQuestionData())
...

No route matched for preloading js assets

I am navigating to a dynamic route via link which is correct but it just changes the route segments and things it is not actually navigating me to page nor loading the page, I have to manually refresh the page to see content, even after refreshing the desired page which is on that dynamic route buttons don't work and links to other pages does the same thing. But if I don't navigate to this dynamic route and navigate to other routes everything works fine I want to fix routing problems buttons not getting clicked Tried clearing cache restarting server looked around the code but couldn't find a problem...

How to wrap a store without losing reactivity

Given a store like this: ```ts const [store setStore] = createStore({ users: [...