Skip to content

Version 1.7.3: Argument of type 'DateValueType' is not assignable to parameter of type 'SetStateAction<{ startDate: null; endDate: null; }>' #321

Description

@tchangqikr

I'm working with React 18 and wanted to install this version of the Datepicker. I ran npm install react-tailwindcss-datepicker@1.7.3 and updated the dependencies to match. Then I added the following code to my Tailwind config file:

content: [
        "./src/**/*.{js,jsx,ts,tsx}",
        "./node_modules/react-tailwindcss-datepicker/dist/index.esm.js"
    ]

Since I'm working with ES modules, the format ended up being more like

export default {
  content: [
        './src/**/*.{js,ts,jsx,tsx}', 
        "./node_modules/react-tailwindcss-datepicker/dist/index.esm.js"
  ],

When I try to implement the Datepicker with the following snippet:

<Datepicker value={value} onChange={newValue => setValue(newValue)} />

I get the following error:

Argument of type 'DateValueType' is not assignable to parameter of type 'SetStateAction<{ startDate: null; endDate: null; }>'.
  Type 'null' is not assignable to type 'SetStateAction<{ startDate: null; endDate: null; }>'.ts(2345)

Not really sure what to do from here, since I followed the setup as best I could. Do you have any ideas?

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions