Skip to content

Commit 8d7ccfd

Browse files
authored
make data prop optional
When using the `Output` component this will be passed automatically.
1 parent b277aff commit 8d7ccfd

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/transform-plotly/src/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import cloneDeep from "lodash.clonedeep";
33
import React from "react";
44

55
interface Props {
6-
data: string | object;
6+
data?: string | object;
77
mediaType: "application/vnd.plotly.v1+json";
88
}
99

@@ -100,6 +100,7 @@ export class PlotlyTransform extends React.Component<Props> {
100100
};
101101

102102
render() {
103+
if (!this.props.data) return null;
103104
const { layout } = this.getFigure();
104105
const style: React.CSSProperties = {};
105106
if (layout && layout.height && !layout.autosize) {

0 commit comments

Comments
 (0)