Skip to content
This repository has been archived by the owner on Jul 1, 2022. It is now read-only.

Commit

Permalink
fix: clone schedule props when calling setSchedule
Browse files Browse the repository at this point in the history
* some mutation occurs inside the Calendar instance.
  it makes comparison of `schedules` prop impossible.
  • Loading branch information
Dohyung Ahn committed Jan 26, 2022
1 parent ee29b48 commit ff1361f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,9 @@ export default class Calendar extends React.Component {

setSchedules(schedules) {
if (schedules && schedules.length) {
this.calendarInst.createSchedules(schedules);
const clonedSchedules = this.cloneData(schedules);

this.calendarInst.createSchedules(clonedSchedules);
}
}

Expand Down

0 comments on commit ff1361f

Please sign in to comment.