Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

not working from next.js 13 & need server side supports for next.js 13 #1127

Open
restareaByWeezy opened this issue Dec 8, 2022 · 4 comments

Comments

@restareaByWeezy
Copy link

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
}

#1109

but still not working for me (even from client side).
Any solutions suggested?

@Nedilko
Copy link

Nedilko commented Dec 25, 2022

I successfully done with setting stitches with next13. Use hook useServerInsertedHTML

@jvgreenaway
Copy link

@Nedilko Do you have some example code - I can only get client-side style rendering to work.

I think this is a duplicate of #1109.

@Nedilko
Copy link

Nedilko commented Dec 31, 2022

I created client a wrapper, where I simply use hook useServerInsertedHTML. Inside this hook I return style tag.

@leonace924
Copy link

@Nedilko, could you put the code snippet here?
I didn't find the solution
Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants