Skip to content

Commit

Permalink
Use a class instead of a function (fix #108)
Browse files Browse the repository at this point in the history
  • Loading branch information
gpbl committed Dec 3, 2015
1 parent 2bc5fb9 commit 99de176
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/DayPicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,16 @@ const keys = {
SPACE: 32
};

function Caption({ date, locale, localeUtils, onClick }) {
return (
<div className="DayPicker-Caption" onClick={ onClick }>
{ localeUtils.formatMonthTitle(date, locale) }
</div>
);
class Caption extends Component {

render() {
const { date, locale, localeUtils, onClick } = this.props;
return (
<div className="DayPicker-Caption" onClick={ onClick }>
{ localeUtils.formatMonthTitle(date, locale) }
</div>
);
}
}

export default class DayPicker extends Component {
Expand Down

0 comments on commit 99de176

Please sign in to comment.