foolswisdom
foolswisdom
SSolidJS
Created by Believe037 on 1/12/2025 in #support
@solidjs/router not working
Great
23 replies
SSolidJS
Created by Believe037 on 1/12/2025 in #support
@solidjs/router not working
👍
23 replies
SSolidJS
Created by Believe037 on 1/12/2025 in #support
@solidjs/router not working
Try moving Router to inside the App component, wrapping the Route directly
23 replies
SSolidJS
Created by Believe037 on 1/12/2025 in #support
@solidjs/router not working
I think the issue is that the router requires Route components to be direct children
23 replies
SSolidJS
Created by Believe037 on 1/12/2025 in #support
@solidjs/router not working
This the App file. I'm asking about the Home file
23 replies
SSolidJS
Created by Believe037 on 1/12/2025 in #support
@solidjs/router not working
Please enclose code blocks in triple back ticks for readability
23 replies
SSolidJS
Created by Believe037 on 1/12/2025 in #support
@solidjs/router not working
I meant to create a new thread here in #support. It's fine
23 replies
SSolidJS
Created by Believe037 on 1/12/2025 in #support
@solidjs/router not working
What are the contents of Home.tsx?
23 replies
SSolidJS
Created by Believe037 on 1/12/2025 in #support
@solidjs/router not working
I will note, that solid-app-router is superseeded by @solidjs/router, there's no reason to have both in the same project
23 replies
SSolidJS
Created by Believe037 on 1/12/2025 in #support
@solidjs/router not working
You should perhaps open a ticket explaining the issues you are facing
23 replies
SSolidJS
Created by Believe037 on 1/12/2025 in #support
@solidjs/router not working
It appears to you have your editor set to warn you when misspelled / unknown words are words. solidjs may not appear in the dictionary, but that makes it no less a valid package namespace, and @solidjs/router is the correct package name. This does not stop your package manager from installing it, or is simply the vscode extension warning that it doesn't know this word
23 replies
SSolidJS
Created by Leal on 1/5/2025 in #support
Unable to provide context to children
In your example @peerreynders, children are created lazily in the jsx template. If you move the (nominally identical) access up above the jsx, it becomes eager and context will no longer work
13 replies
SSolidJS
Created by Leal on 1/5/2025 in #support
Unable to provide context to children
It isn't clear where props.children was used. If it's in the same place as where the children are accessed / created in the above code, that would result in the same problem. Or to restate the issue: the children helper does not change where the creation of children occurs, it's merely a helper to memoize so they're only created once. And the problem is that creating the children in the body of the component, above the jsx, is above the provider boundary.
13 replies
SSolidJS
Created by Leal on 1/5/2025 in #support
Unable to provide context to children
https://docs.solidjs.com/reference/component-apis/children#children Towards the bottom (though it sadly doesn't call out the implications for context)
An important aspect of the children helper is that it forces the children to be created and resolved, as it accesses props.children immediately.
13 replies
SSolidJS
Created by Leal on 1/5/2025 in #support
Unable to provide context to children
The problem here is that the children are created early. Normally, props.children is a lazy access, so the children are created under the context provider boundary. In this case, you're eagerly accessing it in the solidChildren function (it's a wrapper around memo, which is eager). This means you're freaking the children outside the boundary.
13 replies
SSolidJS
Created by webstrand on 10/22/2024 in #support
How are you supposed to satisfy refs when not forwarding to a pure DOM node?
I expect there's nothing built in. The types are often written with elements in mind, reusing them for components may not be feasible. In some cases it makes sense to adjust the existing types (make a PR), sometimes not
6 replies
SSolidJS
Created by webstrand on 10/22/2024 in #support
How are you supposed to satisfy refs when not forwarding to a pure DOM node?
The compiler behavior applies to any prop named ref, iirc
6 replies
SSolidJS
Created by webstrand on 10/22/2024 in #support
How are you supposed to satisfy refs when not forwarding to a pure DOM node?
The ref prop received will be a function, even if the type passed to the ref prop is a variable (the compiler will simply create a function that takes a value and assigns to that variable). The Ref type allows for both, because it's defined in terms of the type that can be passed. If you don't like that, you should use a different type. The reason the type includes undefined is because you explicitly added undefined to the type generic passed to Ref, so of course TS says it's possibly undefined
6 replies
SSolidJS
Created by Mr Void on 9/16/2024 in #support
Reset signals when prop value changes
Anyway, if it works it works
8 replies
SSolidJS
Created by Mr Void on 9/16/2024 in #support
Reset signals when prop value changes
Not quite a fit
8 replies