Open acro5piano opened 4 years ago
Couldn't use innerRef object at least RN 60. For example, ref.current.scrollTo({ y: 1000 }) does not work.
innerRef
ref.current.scrollTo({ y: 1000 })
const App = () => { const ref = React.useRef() const scroll = React.useCallback(() => { ref.current && ref.current.getNode().scrollTo({ y: 10000 }) }, [ref.current]) return ( <> <Button onPress={scroll} title="let's scroll" /> <ParallaxScroll ref={ref}><View style={{ height: 1500 }} /></ParallaxScroll> </> ) }
causes an error ref.current.getNode is not a function
ref.current.getNode is not a function
I didn't understand ref._component, but it should accept ref itself. so I've added forwarding ref if ref._component is not set.
ref._component
ref
Problem
Couldn't use
innerRef
object at least RN 60. For example,ref.current.scrollTo({ y: 1000 })
does not work.causes an error
ref.current.getNode is not a function
Changes
I didn't understand
ref._component
, but it should acceptref
itself. so I've added forwardingref
ifref._component
is not set.Related Issues