snorbi
Error during navigation
The <Show> component uses a condition whether the page should be displayed at all (by validating parameters in the URL), or redirected to a fallback page using a <Navigate>.
Maybe this is not the best solution for redirecting to another page based on a condition?
6 replies
Error during navigation
It seems I found it by experimenting and commenting out navigation-related code fragments. It took a long time 😦
I had
<Navigate>
components inside the fallback
parameter of Show
components on the problematic pages.
Removing the <Navigate>
fallbacks solved the problem.6 replies
Third party authentication
Auth.js has SolidJS support: https://authjs.dev/reference/solid-start
It supports OAuth: https://authjs.dev/getting-started/authentication/oauth
(Please note: I have not used it, I have only read about it.)
4 replies
Access ref in child component when using forwarding refs
I'm a bit lost how refs work 😦
What I try to achieve is to create a component which wraps various children 3-4 components deep, and to propagate the ref of the deepest component to the top level component.
It is something like:
(I know it is not ideal from an "encapsulation" viewpoint. I have other ideas how to solve the problem but I'm very curious whether it is possible to propagate
ref
s "upwards".)
What I would like is to know the ref of the <input>
at the level of ValidatingInputFieldWithLabel
, so I can add event listeners to the <input>
.
What is the best solution?
Besides, can someone explain what is the magic behind the ref feature? Until now I thought I understand it but now I'm a bit confused, e.g. how can I know that it is a simple Element or a Function? Or should I always check it at runtime in my custom components?
Thanks.6 replies
Reactive context in built-in components
Maybe I found them?
https://github.com/solidjs/solid/blob/fff8aed62b4bff78a0016c3c08ba644652ccac18/packages/solid/src/render/flow.ts#L102
😄
This is rocket science 😄
9 replies
How to extract common reactive code?
Wdym with this?I mean that somehow prevent it to be called from a non-reactive context. Is there for example, some Typescript typing "trick" that can check it at compile-time? Or isn't it that simple? 🙂
11 replies
Solving "computations created outside ..." using `createMemo() ?`
Thanks @mdynnl for looking into it.
I don't understand the "ternaries" part deep enough but it is good to hear that
createMemo()
is the good solution here 🙂
(Although it does not seem to solve the warning in case of your example, it solves it in my code.)17 replies
Solving "computations created outside ..." using `createMemo() ?`
I have created a complete example: https://playground.solidjs.com/anonymous/e0fc8d1e-cfc8-4774-9d5e-ef9068494c00
For some reason I cannot run it in the playground (it is the first time I use it 🥲 ) but I hope it helps (I'm unable to include here because it is too long).
Running it locally on my PC, first I select a value from the first dropdown, then the warning is issued when I select a value from the second dropdown.
Thanks again for looking into it.
17 replies
Solving "computations created outside ..." using `createMemo() ?`
untrack()
does not solve the issue, the warning still arises...
So I must do something incorrectly, as @Andreas Roth suggested 😦
The code is something like this:
And the usage is something like:
Thanks.
Ps.: I'm relatively new in both TypeScript/Javascript and SolidJS17 replies