Skip to content

Commit

Permalink
fix: change toolbar API to match top level onViewChange prop name
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
mmmbacon authored and jquense committed Jul 30, 2018
1 parent fb96199 commit b0a6dd7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -859,7 +859,7 @@ class Calendar extends React.Component {
view={view}
views={viewNames}
label={label}
onViewChange={this.handleViewChange}
onView={this.handleViewChange}
onNavigate={this.handleNavigate}
localizer={localizer}
/>
Expand Down
4 changes: 2 additions & 2 deletions src/Toolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class Toolbar extends React.Component {
label: PropTypes.node.isRequired,
localizer: PropTypes.object,
onNavigate: PropTypes.func.isRequired,
onViewChange: PropTypes.func.isRequired,
onView: PropTypes.func.isRequired,
}

render() {
Expand Down Expand Up @@ -51,7 +51,7 @@ class Toolbar extends React.Component {
}

view = view => {
this.props.onViewChange(view)
this.props.onView(view)
}

viewNamesGroup(messages) {
Expand Down

0 comments on commit b0a6dd7

Please sign in to comment.