how do you set attributes on `<Html>` and `<Body>` from within a route?

this should happen on the server side so the attributes are set before the js is loaded
5 Replies
Samual 🦢
Samual 🦢OP•17mo ago
if this is not yet possible, someone tell me so I can make an issue
Jérémy
Jérémy•17mo ago
You'll be able to achieve that with context https://www.solidjs.com/tutorial/stores_context
SolidJS
Solid is a purely reactive library. It was designed from the ground up with a reactive core. It's influenced by reactive principles developed by previous libraries.
Samual 🦢
Samual 🦢OP•17mo ago
how does context achieve this?
Jérémy
Jérémy•17mo ago
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.
Samual 🦢
Samual 🦢OP•17mo ago
are you talking about using reactivity to update the attributes? I can already do that without context, but it won't help this needs to happen on the server and none of the reactive primitives do anything server side
Want results from more Discord servers?
Add your server