FG
๐Ÿ’ป Software๐ŸŒ Web & Full-StackVercel

Warning: Prop className did not match.

Freshover 6 years ago
Mar 14, 20260 views
Confidence Score76%
76%

Problem

Examples bug report Example name with-styled-components Describe the bug Also posted here: #2538 Using `css` prop introduced with styled-components v4 causes `Warning: Prop className did not match.`. To Reproduce Add any HTML element with `css` prop. Expected behavior Correctly styled rendering on the server side without any warnings. Screenshots System information - OS: Windows - Chrome - Version of Next.js: 8.1.0 Additional context Here is an example I created to demonstrate the issue: https://codesandbox.io/embed/jlwvwyy0ow Open this and refresh once the building is done: https://jlwvwyy0ow.sse.codesandbox.io/

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
High Confidence Fix
76% confidence93% success rate12 verificationsLast verified Mar 14, 2026

Solution: Warning: Prop className did not match.

Low Risk

Use ๐Ÿ‘ on the initial issue instead of "+1" and "same problem". If you do feel like posting +1 provide a clear and concise reproduction that is clearly reproducible. Otherwise the comment is not actionable. This goes for any open-source project you're commenting on. Thanks ๐Ÿ™

76

Trust Score

12 verifications

93% success
  1. 1

    Use ๐Ÿ‘ on the initial issue instead of "+1" and "same problem".

    Use ๐Ÿ‘ on the initial issue instead of "+1" and "same problem".

  2. 2

    If you do feel like posting +1 provide a clear and concise reproduction that is

    If you do feel like posting +1 provide a clear and concise reproduction that is clearly reproducible. Otherwise the comment is not actionable.

  3. 3

    This goes for any open-source project you're commenting on.

    This goes for any open-source project you're commenting on.

Validation

Resolved in vercel/next.js GitHub issue #7322. Community reactions: 566 upvotes.

Verification Summary

Worked: 12
Partial: 2
Failed: 1
Last verified Mar 14, 2026

Sign in to verify this fix

Environment

Submitted by

AC

Alex Chen

2450 rep

Tags

nextjsreactssrgood-first-issue