react-datepicker: Year dropdown is not working

Describe the bug The Year dropdown is not working (the datepicker doesn’t provide an options of the year) and users can’t select a year

To Reproduce

  1. Go to the official site https://reactdatepicker.com/#example-year-dropdown
  2. Try to select a year
  3. User sees the error

Expected behavior A clear and concise description of what you expected to happen.

Screenshots Screen Shot 2019-10-29 at 7 18 38 PM Screen Shot 2019-10-29 at 7 19 10 PM

Additional context Example of usage is here

import React from "react";
import DatePicker, { registerLocale } from "react-datepicker";
import de from "date-fns/locale/de";
import Input from "../../input";
registerLocale("de", de);

const DatePickerView = (props) => (
  <DatePicker
    { ...props }
    locale="de"
    yearDropdownItemNumber={15}
    customInput={<Input />}
    scrollableYearDropdown 
    showYearDropdown 
  />
);

package.json

"react-datepicker": "^2.9.6",
"date-fns": "^2.6.0"

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 8
  • Comments: 23 (3 by maintainers)

Most upvoted comments

Have just updated react-datepicker in my project and still see this issue. index.js:1 Warning: findDOMNode is deprecated in StrictMode. findDOMNode was passed an instance of a which is inside StrictMode. Instead, add a ref directly to the element you want to reference.

Also here - it seems to work, but I get the error message in the console.

This should be reopened, the issue is still happening in version 3.6.0

Hello,

Can you help me find a solution

Installed 4.7.0 and still sees the warning about findDOMNode is deprecated for both month and year dropdown.

I’m still seeing Warning: findDOMNode is deprecated in StrictMode using 3.8.0

I downgraded to version 1.8.0 and things are fine again. But of course, if you need features of 2.x.x this will not work.