mrVinicius
mrVinicius
SSolidJS
Created by mrVinicius on 11/28/2024 in #support
Hydration error when using <Show>
yeah, it cleared up, im familiar with the hydration process, my issue really has with the reactivity
14 replies
SSolidJS
Created by mrVinicius on 11/28/2024 in #support
Hydration error when using <Show>
yeah, my mistake was assuming reactivity worked on the server
14 replies
SSolidJS
Created by mrVinicius on 11/28/2024 in #support
Hydration error when using <Show>
hmm, i haven't read the old docs, and in the new there is not a mention of it. Found a quote in the old docs that kind of answers me: Similarly there is no reactivity on the server so do not update signals on initial render and expect them to reflect higher up the tree
14 replies
SSolidJS
Created by mrVinicius on 11/28/2024 in #support
Hydration error when using <Show>
<InputField
name='password'
label='Password'
leading={<LockIcon />}
placeholder='Enter password'
class={'!ps-8 !pe-16'}
/>

const Input: Component<InputProps> = (props) => {
const [local, rest] = splitProps(props, ['leading', 'trailing', 'class', 'variant', 'size']);

//const hasLeading = createMemo(() => local.leading); // this works
//const hasLeading = local.leading; // this works
return (
<div class={'relative'}>
{/* this throws a hydration error */}
<Show when={local.leading}>
{(leading) => (
<div class='absolute inset-y-0 left-0 flex items-center ps-1 pointer-events-none'>
{leading()}
</div>
)}
</Show>

{/* unrelated rest... */}
</div>
);
};
<InputField
name='password'
label='Password'
leading={<LockIcon />}
placeholder='Enter password'
class={'!ps-8 !pe-16'}
/>

const Input: Component<InputProps> = (props) => {
const [local, rest] = splitProps(props, ['leading', 'trailing', 'class', 'variant', 'size']);

//const hasLeading = createMemo(() => local.leading); // this works
//const hasLeading = local.leading; // this works
return (
<div class={'relative'}>
{/* this throws a hydration error */}
<Show when={local.leading}>
{(leading) => (
<div class='absolute inset-y-0 left-0 flex items-center ps-1 pointer-events-none'>
{leading()}
</div>
)}
</Show>

{/* unrelated rest... */}
</div>
);
};
this one left me even more confused, simply reassigning the variable const hasLeading = local.leading before passing into <Show/> solved the hydration issue
14 replies
SSolidJS
Created by mrVinicius on 11/28/2024 in #support
Hydration error when using <Show>
However i didn't fully understand why tho
This leads to a situation in which the server-rendered HTML doesn’t include ”Required” and ”Default” (since the signals are false) but the client-rendered HTML does therefore leading to your hydration error
This leads to a situation in which the server-rendered HTML doesn’t include ”Required” and ”Default” (since the signals are false) but the client-rendered HTML does therefore leading to your hydration error
Why the server doesn't include required/default but the client does? shouldn't they behave the same way? is there a difference with signals on the server vs the client?
14 replies
SSolidJS
Created by mrVinicius on 11/28/2024 in #support
Hydration error when using <Show>
Thanks it solved the problem
14 replies
SSolidJS
Created by James on 10/30/2024 in #support
solid-motionone/@solid-primitives/transition-group - onMount/createEffects called before add to DOM
perhaps u could use a ref signal and check if its no longer undefined, meaning it has rendered on the dom. https://docs.solidjs.com/concepts/refs
2 replies
SSolidJS
Created by mrVinicius on 10/24/2024 in #support
Dynamic Component & Props
thanks
11 replies
SSolidJS
Created by mrVinicius on 10/24/2024 in #support
Dynamic Component & Props
it worked!
11 replies
SSolidJS
Created by mrVinicius on 10/24/2024 in #support
Dynamic Component & Props
oh, what a silly mistake
11 replies
SSolidJS
Created by mrVinicius on 10/24/2024 in #support
Dynamic Component & Props
By the button component
11 replies
SSolidJS
Created by mrVinicius on 10/16/2024 in #support
Store with const obj values passed to it does not update.
Oh, that make sense, thanks for the input!
11 replies
SSolidJS
Created by mrVinicius on 10/16/2024 in #support
Store with const obj values passed to it does not update.
Oh thanks, didn't thought of this approach, worked like a charm
11 replies
SSolidJS
Created by mrVinicius on 10/16/2024 in #support
Store with const obj values passed to it does not update.
how?
setViewable(...initialViewable ) // is invalid
setViewable(() => ({...initialViewable })) // doesnt do anything
setViewable((prev) => ({...prev, ...initialViewable })) // doesnt do anything
setViewable(...initialViewable ) // is invalid
setViewable(() => ({...initialViewable })) // doesnt do anything
setViewable((prev) => ({...prev, ...initialViewable })) // doesnt do anything
11 replies
SSolidJS
Created by mrVinicius on 10/16/2024 in #support
Store with const obj values passed to it does not update.
I feel its javascript memory layout or solid compiler to blame
11 replies
SSolidJS
Created by mrVinicius on 10/16/2024 in #support
Store with const obj values passed to it does not update.
This problem only seem to occur with the initialViewable, a new const obj does work
11 replies
SSolidJS
Created by mrVinicius on 10/10/2024 in #support
Stores & CreateResource
Hmm, that seems to add way too much complexity into my problem, just gonna stick with regular signals for this use case.
10 replies
SSolidJS
Created by mrVinicius on 10/10/2024 in #support
Stores & CreateResource
No description
10 replies
SSolidJS
Created by mrVinicius on 10/10/2024 in #support
Stores & CreateResource
My guess as to why the store version is not being triggered is that, since I'm not manually calling an item from the store, the reactive system isn't being set. With that said, is there a workaround for this, or should I just use a signal?
10 replies
SSolidJS
Created by mrVinicius on 8/29/2024 in #support
Help styling an component via props using TailwindCss.
i'll test this properly later, or else i'll use splitProps
28 replies