REEEEE
REEEEE
SSolidJS
Created by ⯁ 𝓥𝓪𝓵𝓮𝓻𝓲𝓮 on 11/10/2024 in #support
how to manage global signals interacting with other global signals properly?
yup
17 replies
SSolidJS
Created by ⯁ 𝓥𝓪𝓵𝓮𝓻𝓲𝓮 on 11/10/2024 in #support
how to manage global signals interacting with other global signals properly?
so something like
const [signal, setSignal] = createRoot((dispose) => {
const [mySignal, setMySignal] = createSignal(0)

createEffect(() => ...do something)

return [mySignal, setMySignal]
})
const [signal, setSignal] = createRoot((dispose) => {
const [mySignal, setMySignal] = createSignal(0)

createEffect(() => ...do something)

return [mySignal, setMySignal]
})
17 replies
SSolidJS
Created by ⯁ 𝓥𝓪𝓵𝓮𝓻𝓲𝓮 on 11/10/2024 in #support
how to manage global signals interacting with other global signals properly?
You could also wrap the whole state as well and return the signals from the root
17 replies
SSolidJS
Created by ⯁ 𝓥𝓪𝓵𝓮𝓻𝓲𝓮 on 11/10/2024 in #support
how to manage global signals interacting with other global signals properly?
The simplest way is to wrap it in a createRoot
17 replies
SSolidJS
Created by ⯁ 𝓥𝓪𝓵𝓮𝓻𝓲𝓮 on 11/10/2024 in #support
how to manage global signals interacting with other global signals properly?
The warning is just for informing you that the effect won't be disposed and could lead to some sort of memory leak if you don't know what you're doing AFAIK. Having said that, there is no real issue with doing this and many people prefer to do global signals. Personally, I prefer to encapsulate this sort of information in a context provider if you're going to end up needing to use this in multiple places either a single instance or to create multiple instances
17 replies
SSolidJS
Created by Cyber Grandma on 11/2/2024 in #support
Re: Reset a store to its initial value, doesn't react
use reconcile
3 replies
SSolidJS
Created by agentsmith on 10/31/2024 in #support
Reactivity with shadcn-solid textfield
Because Kobalte, the library shadcn-solid uses, does some input handling to keep the input in sync with the value which might be the cause of the issue you're seeing
14 replies
SSolidJS
Created by agentsmith on 10/31/2024 in #support
Reactivity with shadcn-solid textfield
You could try not using onInput and instead use onChange on the root @agentsmith
14 replies
SSolidJS
Created by agentsmith on 10/31/2024 in #support
Reactivity with shadcn-solid textfield
You could add {equals: false} to the options for the signal that tracks the value
14 replies
SSolidJS
Created by agentsmith on 10/31/2024 in #support
Reactivity with shadcn-solid textfield
Can't see any issues at first glance, what exactly is the issue you're running into? I don't think I understand it yet
14 replies
SSolidJS
Created by webstrand on 10/28/2024 in #support
<Show> not tracking signals
function Counter(props){
return props.count
}
function Counter(props){
return props.count
}
This would not be reactive
28 replies
SSolidJS
Created by webstrand on 10/28/2024 in #support
<Show> not tracking signals
You can think about it like it's another component you just created and your accessing the reactive property in the body rather than the returned jsx. The same thing would fail if you had a component that just returned props.value outside of the jsx
28 replies
SSolidJS
Created by webstrand on 10/28/2024 in #support
<Show> not tracking signals
Because it's being read inside jsx which tracks but in the original all you're doing is taking the passed callback and returning the value. The reference to counter() doesn't change unless the value in the when condition also changes
28 replies
SSolidJS
Created by Đăng Tú on 10/19/2024 in #support
Any tip/checklist to debug Solid components when it refuses to react the signal changed?
Use a Show instead to change what to display depending on a condition
9 replies
SSolidJS
Created by Đăng Tú on 10/19/2024 in #support
Any tip/checklist to debug Solid components when it refuses to react the signal changed?
Unlike React, Solid components don't rerender so your early return in the component will fire and the component won't be updated
9 replies
SSolidJS
Created by mrVinicius on 10/16/2024 in #support
Store with const obj values passed to it does not update.
createStore({...initialViewable})
11 replies
SSolidJS
Created by mrVinicius on 10/16/2024 in #support
Store with const obj values passed to it does not update.
I meant the original store tho
11 replies
SSolidJS
Created by mrVinicius on 10/16/2024 in #support
Store with const obj values passed to it does not update.
setViewable({...initialViewable})
11 replies
SSolidJS
Created by mrVinicius on 10/16/2024 in #support
Store with const obj values passed to it does not update.
It's the same object as the one you passed in that's why, you need to spread the object
11 replies
SSolidJS
Created by Massukka on 10/16/2024 in #support
&& in <Show> when condition and typescript?
It is an accessor
27 replies