@nareshj7/expo-router-v3-top-tabs
TypeScript icon, indicating that this package has built-in type declarations

0.2.0 • Public • Published

@nareshj7/expo-router-v3-top-tabs

Wraps react-native-collapsible-tab-view and adds support for Expo Router v3.

Add the package to your npm dependencies

yarn add @nareshj7/expo-router-v3-top-tabs react-native-reanimated
  • Setup Reanimated in the babel.config.js. See here for more info.

  • If you face 'setPage' undefined error while using try installing react-native-pager-view and react-native-tab-view.

Usage

Example in Layout Route:

// app/(tabs)/_layout.tsx

import { Text, View } from "react-native";
import { TopTabs } from "@nareshj7/expo-router-v3-top-tabs";

export default function CustomLayout() {
  return (
    <TopTabs screenOptions={{}}>
      <TopTabs.Header>
        <View pointerEvents="none" style={{}}>
          <Text>Header</Text>
        </View>
      </TopTabs.Header>

      <TopTabs.Screen name="index" />
    </TopTabs>
  );
}

Usage in child routes:

// app/(tabs)/index.tsx

import { Animated } from "react-native";
import { useScrollProps } from "@nareshj7/expo-router-v3-top-tabs";

export default function Screen() {
  const props = useScrollProps();

  return <Animated.ScrollView {...props}></Animated.ScrollView>;
}

Package Sidebar

Install

npm i @nareshj7/expo-router-v3-top-tabs

Weekly Downloads

4

Version

0.2.0

License

MIT

Unpacked Size

20.4 kB

Total Files

11

Last publish

Collaborators

  • nareshj7