Skip to content

Commit

Permalink
fix(timeline): add rerendering to timeline for item and group updates
Browse files Browse the repository at this point in the history
  • Loading branch information
TomHiller-swd committed Aug 9, 2022
1 parent a8d9906 commit 4d2ff23
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/timeline.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,17 +127,11 @@ class Timeline extends React.Component<Props, {}> {
const currentTimeChange = currentTime !== nextProps.currentTime;

if (groupsChange) {
// eslint-disable-next-line no-console
console.warn(
"react-vis-timeline: you are trying to change 'initialGroups' prop. Please use the public api exposed with in ref",
);
this.timeline.setGroups(nextProps.initialGroups);
}

if (itemsChange) {
// eslint-disable-next-line no-console
console.warn(
"react-vis-timeline: you are trying to change 'initialItems' prop. Please use the public api exposed with in ref",
);
this.timeline.setItems(nextProps.initialItems);
}

if (optionsChange) {
Expand Down

0 comments on commit 4d2ff23

Please sign in to comment.