mirror of
https://github.com/chenasraf/DefinitelyTyped.git
synced 2026-05-18 01:49:01 +00:00
action prop was missing (#57885)
* action prop was missing * Update index.d.ts * Update react-calendar-tests.tsx * Update react-calendar-tests.tsx
This commit is contained in:
1
types/react-calendar/index.d.ts
vendored
1
types/react-calendar/index.d.ts
vendored
@@ -88,6 +88,7 @@ export interface CalendarTileProperties {
|
||||
}
|
||||
|
||||
export interface ViewCallbackProperties {
|
||||
action: string;
|
||||
activeStartDate: Date;
|
||||
value: Date;
|
||||
view: Detail;
|
||||
|
||||
@@ -22,6 +22,10 @@ export default class Sample extends React.Component<{}, State> {
|
||||
this.setState({ value: values[0] });
|
||||
}
|
||||
|
||||
onViewChange = (action: string) => {
|
||||
console.log(`action changed by ${action}`);
|
||||
}
|
||||
|
||||
render() {
|
||||
const { value } = this.state;
|
||||
|
||||
@@ -44,6 +48,7 @@ export default class Sample extends React.Component<{}, State> {
|
||||
<Calendar
|
||||
onChange={this.onRangeChange}
|
||||
showWeekNumbers
|
||||
onViewChange={({action}) => this.onViewChange(action)}
|
||||
closeCalendar={true}
|
||||
value={value}
|
||||
locale="ko-KR"
|
||||
|
||||
Reference in New Issue
Block a user