Skip to content

Select Components used in Next.js will cause hydration error when LocalizedStringProvider's locale is not 'en'  #7366

@Dilettante258

Description

@Dilettante258

Provide a general summary of the issue here

When use Select components with SSR and configured LocalizedStringProvider, it will give rise to a hydration error. It is relevant to SelectValue's placeholder.

🤔 Expected Behavior?

When set LocalizedStringProvider in Next.js and use some components, it shouldn't occur hydration error.

😯 Current Behavior

image

💁 Possible Solution

If set Select's placeholder manually, it won't happened.

https://github.com/adobe/react-spectrum/blob/262cc758b8625002314d3574d3e5269aded7db6c/packages/react-aria-components/src/Select.tsx#L258-265

🔦 Context

No response

🖥️ Steps to Reproduce

https://codesandbox.io/p/devbox/3mjhq3

use Next.js@14

Version

"react-aria-components": "^1.4.1",

What browsers are you seeing the problem on?

Microsoft Edge

If other, please specify.

No response

What operating system are you using?

Windows 11

🧢 Your Company/Team

No response

🕷 Tracking Issue

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions