How to use the @react-navigation/native.useScrollToTop function in @react-navigation/native

To help you get started, we’ve selected a few @react-navigation/native examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github react-navigation / navigation-ex / example / src / Shared / Albums.tsx View on Github external
export default function Albums() {
  const ref = React.useRef(null);

  useScrollToTop(ref);

  return (
    
      {COVERS.map((source, i) => (
        // eslint-disable-next-line react/no-array-index-key
        <img style="{styles.cover}">
      ))}
      {COVERS.map((source, i) =&gt; (
        // eslint-disable-next-line react/no-array-index-key
        <img style="{styles.cover}">
      ))}
github react-navigation / navigation-ex / example / src / Shared / Chat.tsx View on Github external
export default function Chat() {
  const ref = React.useRef(null);

  useScrollToTop(ref);

  const { colors } = useTheme();

  return (
github react-navigation / navigation-ex / example / src / Shared / Article.tsx View on Github external
export default function Article({
  date = '1st Jan 2025',
  author = {
    name: 'Knowledge Bot',
  },
}: Props) {
  const ref = React.useRef(null);

  useScrollToTop(ref);

  const { colors } = useTheme();

  return (
github react-navigation / navigation-ex / example / src / Shared / Contacts.tsx View on Github external
export default function Contacts() {
  const ref = React.useRef&gt;(null);

  useScrollToTop(ref);

  const renderItem = ({ item }: { item: Item }) =&gt; ;

  return (
     String(i)}
      renderItem={renderItem}
      ItemSeparatorComponent={ItemSeparator}
    /&gt;
  );
}