`currentView` missing from `DatetimepickerState` in TS `typings/DateTime.d.ts`
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Stale
- Tech stack
- react, typescript
- Domain
- frontend
Research direction
Start in typings/DateTime.d.ts and compare DatetimepickerState with the component state initializer shown in the issue. Check the ViewMode declaration and the existing state fields, then verify that the TypeScript state update accepts currentView and that the declared shape matches the implementation.
Written by the indexing model from the issue text.
Description
I'm Submitting a ...
[x] Bug report
[ ] Feature request
[ ] Support request
I am currently using the TypeScript types from the Datetime component and noticed when I try to access the state.currentView I get this TS error Argument of type '{ currentView: string; }' is not assignable to parameter of type 'DatetimepickerState | ((prevState: Readonly<DatetimepickerState>, props: Readonly<DatetimepickerProps>) => DatetimepickerState | ... 1 more ... | null) | Pick<...> | null'.
Looking at the code looks like you have
this.state = {
open: !props.input,
currentView: props.initialViewMode || this.getInitialView(),
viewDate: this.getInitialViewDate(selectedDate),
selectedDate:
selectedDate && selectedDate.isValid() ? selectedDate : undefined,
inputValue: this.getInitialInputValue(selectedDate),
};
And in DateTime.d.ts you have
export interface DatetimepickerState {
updateOn: string;
inputFormat: string;
viewDate: Moment;
selectedDate: Moment;
inputValue: string;
open: boolean;
}
Shouldn't DatetimepickerState include currentView: ViewMode in the interface and it seems like you can remove updateOn: string;?
- Dominant language
- JavaScript
- Stars
- 2k
- Forks
- 858
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from arqex/react-datetime
-
Difficulty 5/5 Over a week Newbie friendliness 45/100
arqex/react-datetime#880 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
arqex/react-datetime#876 · 2 comments · 3 reactions ·
-
Disable past time Open
Difficulty 3/5 1-2 days Newbie friendliness 35/100
arqex/react-datetime#874 ·
-
Difficulty 5/5 Over a week Newbie friendliness 15/100
arqex/react-datetime#873 · 2 comments ·
-
Difficulty 1/5 Under an hour Newbie friendliness 45/100
arqex/react-datetime#871 · 3 comments ·
All issues in arqex/react-datetime
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
HarperFast/skills#96 ·
-
[Block] Latest Posts [Type] Bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Automattic/studio#4908 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
sugarlabs/musicblocks#8847 ·