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:
adammo94
2022-01-19 20:45:38 +01:00
committed by GitHub
parent 60238e8182
commit 4b8ab79bbe
2 changed files with 6 additions and 0 deletions

View File

@@ -88,6 +88,7 @@ export interface CalendarTileProperties {
}
export interface ViewCallbackProperties {
action: string;
activeStartDate: Date;
value: Date;
view: Detail;

View File

@@ -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"