SolidJSS
SolidJSโ€ข2y agoโ€ข
10 replies
andrezero

SSR/SSG: How to share context between client and server

I am trying to implement a Design System of sorts using SolidJS (my prior experience is with React) and ran into this challenge:

How can we provide dynamic context that is both available when rendering document <html> as well as to components that need to consume it at both SSR and CSR time?

I was able to wrap the server side rendered document with a provider and everything works fine here ๐Ÿฅณ (which means that most of the features I am looking at will be straightforward to implement).

But the context is not available anywhere inside the start-client tree.

Is there a known strategy to achieve this?

Thanks in advance ๐Ÿ™‡โ€โ™‚๏ธ
Was this page helpful?