diff --git a/src/index.tsx b/src/index.tsx index 956da454..8e3905f4 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -305,7 +305,9 @@ export default class RNSketchCanvas extends React.Component< (this._sketchCanvas = ref)} + ref={(ref) => { + this._sketchCanvas = ref; + }} style={this.props.canvasStyle} strokeColor={ this.state.color + diff --git a/src/types.tsx b/src/types.tsx index de1e3dd0..4460e6a5 100644 --- a/src/types.tsx +++ b/src/types.tsx @@ -1,3 +1,4 @@ +import type { JSX } from 'react'; import type { StyleProp, ViewStyle } from 'react-native'; export type ImageType = 'png' | 'jpg';