not working from next.js 13 & need server side supports for next.js 13
restareaByWeezy opened this issue · comments
easeurmind commented
Bug report
I tried on next.js 13 app dir and it seems styling is not working.
I read the issue below and found couple of answers to figure it out
example:
"use client"
import React from "react"
import { useServerInsertedHTML } from "next/navigation"
import { getCssText } from "../../stitches.config"
export function ServerStylesheet({ children }) {
useServerInsertedHTML(() => {
return <style id="stitches" dangerouslySetInnerHTML={{ __html: getCssText() }} />
})
return children
}
but still not working for me (even from client side).
Any solutions suggested?
Oleksandr Nedilko commented
I successfully done with setting stitches with next13. Use hook useServerInsertedHTML
James Greenaway commented
Oleksandr Nedilko commented
I created client a wrapper, where I simply use hook useServerInsertedHTML. Inside this hook I return style tag.