SolidJS

S

SolidJS

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

Join

Persist routes between reloads with @solidjs/router

It's strange but for some reason when i do a reload ( with an f5 for example), the direction changes to the root direction. Before, in other apps it persisted the route direction. Any ideas of what it can be?

Can I react/listen on store changes?

I a variable I have been explicitly listening on changes to: ``` createEffect(on(mySignal, () => { doThing(); }));...

Can reconcile be used on its own?

Hi! The documentation doesn't go into a lot of detail on what reconcile does exactly. Can I use it "on its own" detached from reactivity? That is, is it just a function that shallowly diffs and unions the two objects? Or does it 'communicate' with reactivity somehow? The context here is that I'm trying to pre-optimize a custom signal-returning function that I already know will change frequently and have a lot of rows singly nested in an array, with only a few rows being added to the bottom each time. I currently have it working as a signal, not a store, but I'd like to try using reconcile here anyway. I realize the answer here might be "no, just use a store," but that's exactly what I'm asking essentially and I'm also just curious....

How do i deploy solidjs app to github-pages?

I was switching my react project to solidjs because react is pain to work with. Im following crash course from netninja (https://youtube.com/playlist?list=PL4cUxeGkcC9gU_GvFygZFu0aBysPilkbB&si=q1L9cKbze_EWZF_H) but now i dont know how to deploy it, i tried to search some on google but theyre using solidstart which i guess i didnt use?? Im only using solidjs with vite. Any article or even guide will really help, thanks! I tried deploy using npm gh-pages...
No description

Problem with bundled UI library

Hi Guys! I have a problem with my UI library: I have super simple component like this:
const P = (props: { t: Accessor<string> }) => <p>{props.t()}</p>;
const P = (props: { t: Accessor<string> }) => <p>{props.t()}</p>;
...

Route not updating its routeData

Consider the following FileRoutes ``` /[groupId].tsx // layout /[groupId]/(groups).tsx...

Item in store array being overwritten

I have created the following store: { elements: Element[], selectedElement: Element } . When an element from the array is clicked it is assigned to selectedElement. If a new item is selected and assigned to selectedElement, it actually overwrites the value of the previously selected element in the array. Is this the expected behavior?...

computations created outside a `createRoot` or `render` will never be disposed

I have an onClick event that updates a store, and immediately after, it reads a derived value that depends on the store value. It works correctly, the derived value updates immediately before reading it, but since the derived state produces JSX, I am getting the above error. If I instead don't produce JSX I don't get the error. Ive been having a hard time understanding what is happening and what that error means in this context. Could somebody help me?

Add types to context provider

Can someone help me out here, please? For this example from the official doc https://www.solidjs.com/tutorial/stores_context?solved How do you add types to the Counter.jsx as in convert Counter.jsx to Counter.tsx....

Anyone using SolidStart in production?

I want to learn both Solid and SolidStart and I'm curious how your experience has been with using SolidStart in production

Sitemap xml

Hello, i have a question, does solid js and solid start provides a way to have dinamic sitemap xml? thank you very much...

Updating rendered element in HMR?

I'm still working on stack routing and what I need is different transitions between different views. The problem is: if I use rendered element inside <For> loop: ```jsx <AdvancedRouterContext.Provider value={ctx}> <For each={ctx.store.graph}>{item => item.element}</For>...

How to choose between Store and Context?

I've gathered that a store can reside in its own file and be imported in multiple locations, acting as a shared state. Given this, why would I opt for a context when a store seems capable of handling the task? Whether it's for theming or authentication status, a store seems apt. Is there an advantage to using a context, or some trade-offs or crucial factors I might be overlooking?...

React.isValidElement(element)

Is there a similar function in solid?

Using signal in child component

Hi, I'm new to all this and am trying to figure out how to control a signal from a child component. In my case I'm using solid-bootstrap to present a modal. The modal showing and hiding is triggered by a signal 'show' which is set by a button to show it and a cancel button to hide it. ...

HI guys I have a problem with with ssr on my lib. I use rollup

```typescript export default withSolid({ writePackageJson: true, input: "./src/index.tsx",...

Can I Populate A Store Using createResource()?

On the initial render of my app, I want to fetch data from an API using an async function. In React, I could use useEffect() for this. ``` // create a getter and setter for my todos const [todos, setTodos] = useState([]);...

Ref pointing to the wrong element

I have a component that uses a ref: ```tsx let bodyElement: HTMLDivElement; // Somewhere in the TSX: <div class={styles.body} ref={bodyElement!}>...

RouteGuard with FileRoutes

How can I add a routeGuard that allows every page to be protected except few routes like '/login'? I would like to maintain file based routing without having to manually add every route. Thanks!