Jérémy
Jérémy
SSolidJS
Created by Samual 🦢 on 8/15/2023 in #support
how do you set attributes on `<Html>` and `<Body>` from within a route?
You have to define a context. With that, you'll be able to create a context provider. That'll allow you include your tags inside this context provider. Then, from deep in your component tree, you'll have to set a value in your context, that will trigger an update on your provider's value. And you can bind this to a class. If you didn't already did it, I strongly advise to follow the tutorial. It's really well made.
6 replies
SSolidJS
Created by Samual 🦢 on 8/15/2023 in #support
how do you set attributes on `<Html>` and `<Body>` from within a route?
You'll be able to achieve that with context https://www.solidjs.com/tutorial/stores_context
6 replies
SSolidJS
Created by Jérémy on 8/10/2023 in #support
server$ API change in start 0.3.1 ?
2 replies
SSolidJS
Created by Jérémy on 3/7/2023 in #support
Is there a way to hook into the router's match (client)?
Thanks. Hmm… would you have an example of usage?
3 replies
SSolidJS
Created by Jérémy on 12/27/2022 in #support
Can I change the requested URL in a middleware?
Hmm, it seems that nothing gets hydrated on the rendered page.
3 replies
SSolidJS
Created by Jérémy on 12/27/2022 in #support
Can I change the requested URL in a middleware?
So the answer was in fact pretty easy, the trick is to re-create a FetchEvent:
const url = new URL(
`/bim/bam/boum`,
"http://internal"
);
const request = new Request(url.href);

const fetchEvent: FetchEvent = {
request,
env: event.env, // Grab back previous env
};

return forward(fetchEvent);
const url = new URL(
`/bim/bam/boum`,
"http://internal"
);
const request = new Request(url.href);

const fetchEvent: FetchEvent = {
request,
env: event.env, // Grab back previous env
};

return forward(fetchEvent);
3 replies
SSolidJS
Created by apollo79 on 12/13/2022 in #support
SolidStart render page from POST function
Yeah, that's right. In my context, this is not an issue.
10 replies
SSolidJS
Created by Tur on 12/21/2022 in #support
How to pass data from child component to parent?
14 replies
SSolidJS
Created by apollo79 on 12/13/2022 in #support
SolidStart render page from POST function
Maybe that's not really crystal clear, but I really found Felte to intuitive. And I ended up with complex forms quite easily.
10 replies
SSolidJS
Created by apollo79 on 12/13/2022 in #support
SolidStart render page from POST function
Oh ok, I don't know if you know about https://felte.dev/ but, I ended up using it for my project, which is heavy on forms. What I basically did was create a component for each field ; they take as props errors, data, setFields , setErrors, etc from Felte's Form helper. That way I can update the UI according my Zod validation rules, at the UI level. Then on the server (using a API route), I submit the form and I re-use my form Zod Schema (which is composed of field-level schema) to validate the form globally, and process the values.
10 replies
SSolidJS
Created by apollo79 on 12/13/2022 in #support
SolidStart render page from POST function
Did you check this page in the doc? https://start.solidjs.com/core-concepts/actions
10 replies