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 🦢11mo ago
if this is not yet possible, someone tell me so I can make an issue
Jérémy
Jérémy11mo 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 🦢10mo ago
how does context achieve this?
Jérémy
Jérémy10mo 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 🦢10mo 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
More Posts
Anyone know a good solution for using GraphQL in Solid.js?Hi, I've been using Solid.js to build a online gaming application. I'm currently working on the froSignal cross bound a routeHi, I'm new to Solidjs, I wonder if there's a way to make a solid-router to cross bound a signal? ISolid Start with Prisma, when making changes to pages results in routing to 404 page.I just started playing around with Solid Start and am using the Prisma template. I can spin it up juWhat is the proper way to start solid-start in production (especially with something like pm2)?Hey folks, I am currently running solid-start in production with a docker compose setup. Solid staronCleanup in Root component?o/ so i have this component in my root. if i refresh the page, it doesn't log the `cleaning up root!Now using createResource(), the content never loads.``` const getReports = async () => { return (await fetch('/api/reports')).json(); }; export defauAccess child ref from parent componentHello ya'll. I am having a bit of a brain fart, id like to access the child ref of an element from t`Suspense` deep dive 🐬I am dealing with some inconsistencies in how Suspense works between react vs solid while working onCreateeffect not working in component where signal was definedI am pretty new to programming so it is possible I have some kind of oversite. but in this code: ``Replacing specific HTML elements with Solid ComponentsHey. I have a string with html markup, I want to replace some specific elements (based on some attri