Skip to content

Commit

Permalink
fix: removing explict returns
Browse files Browse the repository at this point in the history
Can cause bugs from missing return values.
  • Loading branch information
markmcdowell committed Aug 10, 2020
1 parent 8d64b63 commit 999b5ac
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion packages/coordinates/src/MouseCoordinateX.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export class MouseCoordinateX extends React.Component<MouseCoordinateXProps> {
private readonly drawOnCanvas = (ctx: CanvasRenderingContext2D, moreProps) => {
const props = this.helper(this.props, moreProps);
if (isNotDefined(props)) {
return null;
return;
}

drawOnCanvas(ctx, props);
Expand Down
2 changes: 1 addition & 1 deletion packages/coordinates/src/MouseCoordinateY.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export class MouseCoordinateY extends React.Component<MouseCoordinateYProps> {
private readonly drawOnCanvas = (ctx: CanvasRenderingContext2D, moreProps) => {
const props = this.helper(this.props, moreProps);
if (isNotDefined(props)) {
return null;
return;
}

drawOnCanvas(ctx, props);
Expand Down
6 changes: 2 additions & 4 deletions packages/core/src/ChartCanvas.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -429,14 +429,12 @@ export class ChartCanvas extends React.Component<ChartCanvasProps, ChartCanvasSt
};

public getCanvasContexts = () => {
const current = this.canvasContainerRef.current;
if (current !== null) {
return current.getCanvasContexts();
}
return this.canvasContainerRef.current?.getCanvasContexts();
};

public generateSubscriptionId = () => {
this.lastSubscriptionId++;

return this.lastSubscriptionId;
};

Expand Down
2 changes: 2 additions & 0 deletions packages/interactive/src/components/HoverTextNearMouse.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ export class HoverTextNearMouse extends React.Component<HoverTextNearMouseProps,
</g>
);
}

return null;
};

private readonly getBgHeight = () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/series/src/StraightLine.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ interface StraightLineProps {
readonly type?: "vertical" | "horizontal";
readonly strokeStyle?: string | CanvasGradient | CanvasPattern;
readonly lineWidth?: number;
readonly lineDash?: strokeDashTypes | Iterable<number> | number[];
readonly lineDash?: strokeDashTypes | number[];
readonly yValue?: number;
readonly xValue?: number;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/tooltip/src/HoverTooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ export class HoverTooltip extends React.Component<HoverTooltipProps> {
private readonly drawOnCanvas = (ctx: CanvasRenderingContext2D, moreProps) => {
const pointer = this.helper(ctx, moreProps);
if (pointer === undefined) {
return null;
return;
}

const { height } = moreProps;
Expand Down

0 comments on commit 999b5ac

Please sign in to comment.