This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const FirstRoute = () => ( | |
<View | |
style={{ | |
flex: 1, | |
backgroundColor: 'rgba(0, 0, 0, 0.64)', | |
justifyContent: 'center', | |
alignItems: 'center', | |
}}> | |
<Text style={{color: 'white', fontSize: 24}}>First page</Text> | |
</View> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, {useEffect} from 'react'; | |
import {Animated, StyleSheet} from 'react-native'; | |
import ReAnimated, { | |
interpolate, | |
useAnimatedStyle, | |
useSharedValue, | |
} from 'react-native-reanimated'; | |
import {NavigationState, Route} from 'react-native-tab-view'; | |
import {Measure} from './types'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, {useEffect, useMemo, useRef, useState} from 'react'; | |
import {TabViewProps, Route} from 'react-native-tab-view'; | |
import {View} from 'react-native'; | |
import {TabBarItem} from './TabBarItem'; | |
import {Measure} from './types'; | |
import {TabBarIndicator} from './TabBarIndicator'; | |
type Props<T extends Route> = Parameters< | |
NonNullable<TabViewProps<T>['renderTabBar']> | |
>[0] & { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, {forwardRef, useCallback} from 'react'; | |
import {TouchableOpacity, Animated, View} from 'react-native'; | |
type Props = { | |
onPress: (index: number) => void; | |
index: number; | |
opacity: Animated.AnimatedInterpolation; | |
ref: React.RefObject<any>; | |
children: React.ReactNode; | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import {TabViewProps, Route} from 'react-native-tab-view'; | |
import {View} from 'react-native'; | |
import {TabBarItem} from './TabBarItem'; | |
type Props<T extends Route> = Parameters< | |
NonNullable<TabViewProps<T>['renderTabBar']> | |
>[0] & { | |
onIndexChange: (index: number) => void; | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const FirstRoute = () => ( | |
<View | |
style={{ | |
flex: 1, | |
backgroundColor: 'rgba(0, 0, 0, 0.64)', | |
justifyContent: 'center', | |
alignItems: 'center', | |
}}> | |
<Text style={{color: 'white', fontSize: 24}}>First page</Text> | |
</View> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const App = () => { | |
const isDarkMode = useColorScheme() === 'dark'; | |
const backgroundStyle = { | |
backgroundColor: isDarkMode ? Colors.darker : Colors.lighter, | |
}; | |
const [index, setIndex] = useState(0); | |
const [routes] = useState<TabViewRoute[]>( | |
tabRoutes as unknown as TabViewRoute[], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, {forwardRef, useCallback} from 'react'; | |
import {TouchableOpacity, Animated, View} from 'react-native'; | |
type Props = { | |
onPress: (index: number) => void; | |
index: number; | |
ref: React.RefObject<any>; | |
children: React.ReactNode; | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import {TabViewProps, Route} from 'react-native-tab-view'; | |
import {View} from 'react-native'; | |
import {TabBarItem} from './TabBarItem'; | |
type Props<T extends Route> = Parameters< | |
NonNullable<TabViewProps<T>['renderTabBar']> | |
>[0] & { | |
onIndexChange: (index: number) => void; | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Sample React Native App | |
* https://github.com/facebook/react-native | |
* | |
* Generated with the TypeScript template | |
* https://github.com/react-native-community/react-native-template-typescript | |
* | |
* @format | |
*/ |
NewerOlder