diff --git a/src/hoc.tsx b/src/hoc.tsx index aa6a5a0..0089d8a 100644 --- a/src/hoc.tsx +++ b/src/hoc.tsx @@ -60,13 +60,15 @@ export const wrapScrollViewHOC = ( } handleRef = (ref: LegacyRef) => { - // @ts-ignore - this.ref.current = ref; - if (this.props.innerRef) { - if (typeof this.props.innerRef.current !== 'undefined') { - this.props.innerRef.current = ref; - } else { - this.props.innerRef(ref); + if (ref !== null) { + // @ts-ignore + this.ref.current = ref; + if (this.props.innerRef) { + if (typeof this.props.innerRef.current !== 'undefined') { + this.props.innerRef.current = ref; + } else { + this.props.innerRef(ref); + } } } };