Xiphe / remix-island

utils to render remix into a dom-node instead of the whole document
MIT License
131 stars 7 forks source link

Any way to use a context provider around the head ? #9

Closed erwan-joly closed 1 year ago

erwan-joly commented 1 year ago

Trying to figure out if there is any way to use a context provider around the head ? Some parts of my head are defined into a config that I usually retrieve using a useConfig hook. Is there anyway to get this data in the head part ?

Xiphe commented 1 year ago

I'm afraid no, sorry.

The server markup is generated using two dedicated renders and the <Head /> component is being rendered outside of the context of your app...

As this is library serves only as a hacky workaround until react@18.3 lands I myself won't invest time to make it work but if you see a simple solution to this feel free to provide a PR.