Jérémy
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
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
How to pass data from child component to parent?
Have a look at Context https://www.solidjs.com/tutorial/stores_context
14 replies
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
SolidStart render page from POST function
Did you check this page in the doc?
https://start.solidjs.com/core-concepts/actions
10 replies