calendar component type null issue #2053
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I m following this demo https://codesandbox.io/s/hejhs?file=/src/demo/CalendarDemo.tsx:2121-2154 which contains some errors in all setDate hooks like this one setDate8(e.value)
here is the error description
CalendarChangeParams.value: Date | Date[] | null | undefined
Argument of type 'Date | Date[] | null | undefined' is not assignable to parameter of type 'SetStateAction<Date | Date[] | undefined>'.
Type 'null' is not assignable to type 'SetStateAction<Date | Date[] | undefined>'.ts(2345)
when I check the declaration file of the calendar component I found that the interface CalendarChangeParams contains the value propriety which may have a null I tried to change this and I removed the null option it works fine so thank you, for verifying this issue.
###Defect Fixes
When submitting a PR, please also create an issue documenting the error.
###Feature Requests
Due to company policy, we are unable to accept feature request PRs with significant changes as such cases has to be implemented by our team following our own processes.
Smaller scaled feature implementations such as adding a property to a component will be considered for merging.