Skip to content

Commit b0a6dd7

Browse files
mmmbaconjquense
authored andcommitted
fix: change toolbar API to match top level onViewChange prop name
* Changed Toolbar prop name to resolve error when creating custom component toolbar * Modified generated toolbar component in Calendar to have onView property instead of onViewChange
1 parent fb96199 commit b0a6dd7

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/Calendar.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -859,7 +859,7 @@ class Calendar extends React.Component {
859859
view={view}
860860
views={viewNames}
861861
label={label}
862-
onViewChange={this.handleViewChange}
862+
onView={this.handleViewChange}
863863
onNavigate={this.handleNavigate}
864864
localizer={localizer}
865865
/>

src/Toolbar.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class Toolbar extends React.Component {
1010
label: PropTypes.node.isRequired,
1111
localizer: PropTypes.object,
1212
onNavigate: PropTypes.func.isRequired,
13-
onViewChange: PropTypes.func.isRequired,
13+
onView: PropTypes.func.isRequired,
1414
}
1515

1616
render() {
@@ -51,7 +51,7 @@ class Toolbar extends React.Component {
5151
}
5252

5353
view = view => {
54-
this.props.onViewChange(view)
54+
this.props.onView(view)
5555
}
5656

5757
viewNamesGroup(messages) {

0 commit comments

Comments
 (0)