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

DateRangePicker doesn't seem to work in React/NextJS #20

Open
anargiris opened this issue Aug 2, 2023 · 2 comments
Open

DateRangePicker doesn't seem to work in React/NextJS #20

anargiris opened this issue Aug 2, 2023 · 2 comments

Comments

@anargiris
Copy link

anargiris commented Aug 2, 2023

I've been trying to implement the DateRangePicker with no success.

I am using NextJS app router v:^13.4.8
Here is the code:

import DateRangePicker from "flowbite-datepicker/DateRangePicker";

 const datepickerRef = useRef();
  useEffect(() => {
    if (datepickerRef?.current) {
      new DateRangePicker(datepickerRef.current, {});
    }
  }, []);
  

return (
      <input
         ref={datepickerRef}
         type="text"
         placeholder="Select date"
      />
)

Note: The original DatePicker works just fine using the same method.

@netgfx
Copy link

netgfx commented Aug 2, 2023

Same issue can be seen here in this example https://codesandbox.io/s/flowbite-react-datepicker-forked-yhdv6p?file=/src/App.js

@mo9a7i
Copy link

mo9a7i commented Oct 22, 2023

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

3 participants