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

[BUG] - DateRangePicker Hydration error #4658

Open
z1glr opened this issue Jan 27, 2025 · 2 comments
Open

[BUG] - DateRangePicker Hydration error #4658

z1glr opened this issue Jan 27, 2025 · 2 comments

Comments

@z1glr
Copy link

z1glr commented Jan 27, 2025

HeroUI Version

2.6.14

Describe the bug

Using a DateRangePicker element in an otherwise empty and fresh next.js project causes a hydration error:

Hydration failed because the server rendered HTML didn't match the client. As a result this tree will be regenerated on the client. This can happen if a SSR-ed Client Component used

...
 <ClientPageRoot Component={function App} searchParams={{}} params={{}}>
    <App params={Promise} searchParams={Promise}>
      <div className="">
        <h1>
          <DatePicker2 isRequired={true} label="Event date" name="date" variant="bordered" hideTimeZone={true} ...>
            <DateInput2 as={undefined} label="Event date" ref={{current:null}} inputRef={undefined} ...>
              <HeroUI.DateInputGroup as={undefined} label="Event date" description={undefined} ...>
                <div data-slot="base" data-required="true" data-disabled={undefined} data-readonly={undefined} ...>
                  <div onKeyDown={function} onClick={function onClick} onPointerDown={function} onMouseDown={function} ...>
                    <span>
                      <div ref={{current:null}} data-slot="inner-wrapper" className="flex items...">
                        <HeroUI.DateInputField classNames={{}} inputProps={{type:"text", ...}} slots={{base:function, ...}} ...>
                          <div data-slot="input-field" data-invalid={undefined} id="react-aria..." data-open={undefined} ...>
                            <DateInputSegment>
                              <DateInputSegment>
                                <DateInputSegment>
                                  <DateInputSegment>
                                    <DateInputSegment>
                                      <DateInputSegment>
                                        <DateInputSegment>
                                          <DateInputSegment>
                                            <DateInputSegment>
                                              <DateInputSegment classNames={{}} segment={{type:"literal", ...}} slots={{base:function, ...}} ...>
                                                <div
                                                  aria-hidden={true}
                                                    ref={{current:null}}
                                                      className={"group first:-ml-0.5 [&:not(:first-child)]:-ml-1 px-0.5 my-auto box-content ..."}
                                                        data-editable={undefined}
                                                          data-invalid={undefined}
                                                            data-placeholder={undefined}
                                                              data-slot="segment"
                                                                data-type="literal"
                                                                  style={{}}
                                                                    >
                                                                      ...
                                                                        ...
                                                                          ...
                                                                            ...
                                                                              ...
                                                                                ...
+                                                                      {" "}
-                                                                      {" "}

Your Example Website or App

No response

Steps to Reproduce the Bug or Issue

  1. Create a next.js app with npx create-next-app@latest
  2. manually install heroui: npm install @heroui/react framer-motion and add it to the tailwind config
  3. Add the herouiprovider and a daterangepicker
  4. start the dev server

Expected behavior

Just a standard DateRangePicker as in the docs

Screenshots or Videos

No response

Operating System Version

linux

Browser

Firefox

Copy link

linear bot commented Jan 27, 2025

@wingkwong
Copy link
Member

please provide a sandbox instead.

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

No branches or pull requests

2 participants