SolidJS

S

SolidJS

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

Join

Is the on change broken for file inputs?

It only ever seems to trigger once, and it's not processing updates. I might have screwed something up.

How to use Hash Mode Router in SolidStart?

I think this is not possible at the moment, as properties for StartRouter isn't configurable, but I'd prefer hash mode routing for SPA.

How to have kind of 'named slot' in Solid like Vue?

I know there is 'props.children' But I want to place each children to different location inside component. What should I have to do?...

Conditional rendering approach

Hi, it's often the case there is a need to conditionally render components given data that may be undefined. Given how Solid handles reactivity it seems it is not type safe to use boolean evaluation or ternary statement to conditionally render something. The Show component seems to solve this issue but will only provide a callback to render children of keyed is true, I am unsure of the consequences of using keyed. Please see the example below which should illustrate the question fairly clearly. Thanks, any information would be cool....

Solid Show animation?

I'm currently using '@motionone/solid' library. But the bundle size is 20k, very huge... I hope Solid officially support show animation natively ...with small bundle size.....

How to set delay on signal's setter

Hello! I'm trying to set a delay between mouseover and then menu opening. The menu is opened depending on signal state <li>on:mouseover={ setDropdownVisible('block') }</li> Once dropdownVisible() has set I set style display block on the menu I try to create the delay like this : <li>on:mouseover={ setTimeout(setDropdownVisible('block'), 1000) }</li> ...

Should I use 'batch' for store?

I want to call multiple setState. But i'm afraid it will render multiple times. So I wrapped with 'batch'. Is this right?...

How to make custom getter for store?

Can I do it like this? I don't guess the getState function would be reactive. is it possible?...

Plz, What's best store design pattern in this case?

I made a simple example code to explain my current situation. Please see my picture. I have color property as global, also in pages. I made getter and setter to change page color. But if global color is active, The global color should be changed, also should be returned by getter....

I'm having issues deployment a Solid start site to cloudflare pages

The site is working on local and I already follow the steps on start-cloudflare-pages but then I use the command: CLOUDFLARE_ACCOUNT_ID=MY_ACCOUINT npx wrangler pages publish dist/public --project-name=PROJECT_Name I got this error...

Github pages

Does anyone know if a SolidJS app will work with GitHub pages?

Rerender child component with updated props

I've built a pagination component that takes a prop called totalPages, I've created a signal for this as I only know the totalPages once my createResource is done loading. However, the child component does not rerender when totalPages is updated. How do I make the component update itself? Parent Code ```javascript...

Warning computations created outside a `createRoot`....

I have a code like this. Wrapping store using createRoot doesn't solve this. 'createEffect' actually makes the warning. How to solve it?...

Computed getter for store?

I see I have two ways computed getter for store. 1. Using 'get' inside store. 2. Creating function outside store like I did for signal. ...

Vite compiles .jsx files from node_modules as react files

Hey, I'm kind of new to Solid (coming from react, reactivity really bought me in) and it seems like vite isn't working as indented. I've created a new project with npx degit solidjs/templates/ts-tailwindcss my-solid-project, installed solid-query and ran the app. Unfortunately nothing wanted to render and there was an error in the console Uncaught ReferenceError: React is not defined in the QueryClientProvider.jsx. Seeing that I was kind of confused since I'm not using react, when inspec...

How to bind element width, height to signal?

My <div>'s size will be changed by parent or css class. I want to bind div's offsetWidth, offsetHeight to signal inside component. Then I want to do something with the signals. How can I do it? I know there is 'ref' attribute. ...

Pagination Component

Hi all, I'm a beginning developer so bear with me while I go through these noob mistakes. I'm trying to utilize a React component called rc-pagination however when I follow their example my page stops loading and I get an error. I'm basically looking for an easy way to start using a proper pagination component similar to what Ant Design offers. The one I tried implementing: https://pagination-react-component.vercel.app/demo/more#more ...

SolidStart prod build fails to start on `require()`

My site uses a library algosdk that has dependencies which utilize require() in them, which cause the production build to fail with the below error.
```undefined:1 require('crypto') ^...

Show-tag with callback for multiple values

hi all 👋 Is there currently a way to use the Show tag in the callback-form to validate and pass on multiple values? Something like ```<Show when={[var1, var2]} keyed> { ([var1, var2]) => (...var1_and_var2_are_trueish)...

Props

I read on the getting started tutorial that it's best practice not to destructure props object in the function assignment of a component as this will make the properties less reactive. I was wandering if it was ok to destructure the props object in the function body itself?...