Skip to content

Commit

Permalink
fix(core): fixing re-rendering of svg components
Browse files Browse the repository at this point in the history
The update count is increased to trigger a render.
  • Loading branch information
markmcdowell committed Jul 9, 2020
1 parent 54a8ba5 commit af0f156
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion packages/core/src/GenericComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,16 @@ export class GenericComponent extends React.Component<GenericComponentProps, Gen
const proceed = this.props.drawOn.indexOf(type) > -1;

if (proceed || this.props.selected /* this is to draw as soon as you select */ || force) {
this.drawOnCanvas();
const { canvasDraw } = this.props;

if (canvasDraw === undefined) {
const { updateCount } = this.state;
this.setState({
updateCount: updateCount + 1,
});
} else {
this.drawOnCanvas();
}
}
}

Expand Down

0 comments on commit af0f156

Please sign in to comment.