Madaxen86
How to store JSX element in a signal and render it from other elements
Have a look at kobalte.dev
It has a unstyled dialog component.
You can learn a lot how to design such components and it also has key bindings according the w3c standards e.g. close when pressing ESC,…
https://github.com/kobaltedev/kobalte/tree/main/packages/core/src/dialog
6 replies
Issue with Solid JS Routing After Deployment
Can you provide your app.config.ts?
Did you use the provider for the nitro server config:
https://nitro.unjs.io/deploy/providers/vercel
2 replies
How to pass props to context reactively?
And maybe have a look at the existing form libraries:
https://modularforms.dev/solid
Or
https://felte.dev/docs/solid/getting-started
They provide easy interfaces to interact with inputs, form validation also adapters for validation libs like zod.
10 replies
Is there a way to access children props?
If it is just about numbering, you can do this with css and save all the trouble:
https://blog.logrocket.com/styling-numbered-lists-with-css-counters/
Otherwise I usually create a context on the parent (the Editor in this case) and provide a map to which each child can add itself (its ref) onMount and remove itself onCleanup.
And the component can then determine its index by himself by finding itself in the map.
This is how component libraries like kobalte.dev do it as well.
45 replies
With CSR, I see components inside Suspense rendering without waiting for CreateAsync's data
That’s probably just because when loading the page with refresh by the time the server streams the response to the browser the promise is resolved and it shows the actual logo.
If you‘d add a timeout to the getData would will probably also see the fallback image first.
You can use the route load function to preload getData when hovering over an A component. The data is already available on the cache (assuming you have wrapped get data in solid router’s cache function)
2 replies
Incorrect response MIME type. Expected 'application/wasm'.
Maybe this Vite plugin will help:
https://github.com/Menci/vite-plugin-wasm#readme
7 replies
I have a use case for createResource vs normal async await api call.
This doc page might help: https://docs.solidjs.com/solid-start/building-your-application/data-loading
For actions: https://docs.solidjs.com/solid-router/reference/data-apis/action
18 replies
I have a use case for createResource vs normal async await api call.
By using createAsync the server can start streaming anything that is not inside the Suspense. You could also use
to prevent the server from streaming before the promise is resolved.
18 replies
I have a use case for createResource vs normal async await api call.
I don't really get what you do.
It looks like you only want to send data, but what are you getting?
I'd assume you would usually have a getCall like getOtp and then "mutation" where you send data and need to update from the getCall.
18 replies
Is My Understanding Of RouteSectionProps Correct?
I view the load function as the "warmup" for the cache.
The createAsync function inside the component will then get the prefechted data from the cache.
And I never use the props returned to the page, instead I always use the useParams,... helpers, so I am always free to move parts of the page to their own component without the need to pass props around.
So basically my pages look like this:
10 replies
Redirect does not happen during load if there is an awaited call before it.
Instead of redirecting, you could just throw an error.
And add an ErrorBoundary to your component/page.
The fallback of the ErrorBoundary can be component showing a 404.
5 replies