Skip to content

Server/Client style mismatch #9

Open
@react-ghost

Description

Hey there, really enjoyed the tutorial. I wanted to reach out to see if you had a solution for this. Due to the way we are using dark mode I am consistently getting this error in the console for this app, and can't seem to get rid of it:

Warning: Prop `className` did not match. Server: "bg-white text-slate-900 antialiased __className_0ec1f4 dark" Client: "bg-white text-slate-900 antialiased __className_0ec1f4"

It appears to be the way that maybe next themes (???) is appending 'dark' or 'light' on the server side, but it is not reflecting on the client.. Did you happen to encounter this or find a resolution for it? I have resolved this in another project using the original pages directory by migrating the styles to globals.css and using the @apply directive, but it cannot appear to work this way for the app directory because I think i'm understanding we are required to use the and tags in layout.tsx

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions