react-native-intersection-observer icon indicating copy to clipboard operation
react-native-intersection-observer copied to clipboard

How to reset IOScrollView to the starting position?

Open sinkz opened this issue 5 years ago • 1 comments

I trying get ref of IOScrollView for reset this to initial position, but it did not work.

How i can reset this scrollView to initial position?

sinkz avatar Dec 09 '20 16:12 sinkz

just like ScrollView#scrollto

function Demo () {
  const scroller = useRef();
  useEffect(() => {
    scroller.current.scrollTo({ x: 0, y: 1000 }); // @see https://reactnative.dev/docs/scrollview#scrollto
  }, []);
  return (
    <IOScrollView ref={scroller}>
    </IOScrollView>
  );
}

zhbhun avatar Dec 10 '20 07:12 zhbhun