Skip to content

[useDatePickerState]: Cannot use 'in' operator to search for 'timeZone' in null #4619

@artaommahe

Description

@artaommahe

🐛 Bug Report

Also type for DatePickerState.timeValue is wrong - field can be null, but the type is DatePickerState.timeValue: TimeValue. Same with DateRangePickerState.timeRange.

🤔 Expected Behavior

no error and proper type of the field DatePickerState.timeValue: TimeValue | null

😯 Current Behavior

TypeError
Cannot use 'in' operator to search for 'timeZone' in null
    at commitValue (https://rer8g2.csb.app/node_modules/
react-stately/datepicker/dist/module.js:122:26

💁 Possible Solution

🔦 Context

💻 Code Sample

🌍 Your Environment

Software Version(s)
react-spectrum 3.21.0/3.25.0
Browser Chrome
Operating System MacOS

🧢 Your Company/Team

🕷 Tracking Issue (optional)

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

✅ Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions