James
James
SSolidJS
Created by James on 6/28/2024 in #support
@solidjs/start @solidjs/meta not being SSR'd when resources used, bug or my misuse?
See: https://codesandbox.io/p/devbox/clever-leaf-r4xrg6?file=%2Fsrc%2Froutes%2Fabout.tsx The <title> works fine on the About page, but if you view the HTML document the server provides, it is missing the <title> - it is only added by the client. Everything else renders fine! Cheers!
4 replies
SSolidJS
Created by James on 9/18/2023 in #support
React key prop substitute!
I know what you're thinking, James, you silly sausage - Solid.js doesn't require keys for loops, and you're absolutely right but... I need key={} for another reason, I need to cause a component to be entirely unmounted and remounted, which was easily viable in React by just updating its key value in its parent. Any ideas how I can do that in Solid.js? Cheers, James
6 replies
SSolidJS
Created by James on 3/15/2023 in #support
Get SSR attribute value when hydrating
Hi guys! The server generates an attribute value for an element and I don't want to re-generate that attribute value on the browser side because it's unnecessary load on the user device. Is it possible to access the to-be-updated element from within the client side component function code? e.g.
const myAttr = createSignal(isServer ? doHeavyCalculationThing() : hydrationEl.dataset.myAttr);

// return JSX using myAttr
const myAttr = createSignal(isServer ? doHeavyCalculationThing() : hydrationEl.dataset.myAttr);

// return JSX using myAttr
I do still need the doHeavyCalculationThing's code to be given to the client as it will need to re-calculate after an interaction. cheers!
10 replies