diff --git a/components/Carbon.js b/components/Carbon.js index a3b7dbe..f1bcf5b 100644 --- a/components/Carbon.js +++ b/components/Carbon.js @@ -21,12 +21,11 @@ const Watermark = dynamic(() => import('../components/svg/Watermark'), { class Carbon extends React.PureComponent { static defaultProps = { onAspectRatioChange: () => {}, - onChange: () => {}, - innerRef: () => {} + onChange: () => {} } componentDidMount() { - const node = this.exportContainerNode + const node = this.props.innerRef.current this.mo = new MutationObserver(() => { const ratio = node.clientWidth / node.clientHeight this.props.onAspectRatioChange(ratio) @@ -66,11 +65,6 @@ class Carbon extends React.PureComponent { } } - getRef = ele => { - this.exportContainerNode = ele - this.props.innerRef(ele) - } - render() { const config = { ...DEFAULT_SETTINGS, ...this.props.config } @@ -228,7 +222,7 @@ class Carbon extends React.PureComponent { return (