diff --git a/apps/test-examples/App.js b/apps/test-examples/App.js index a07e927bc..8aeafe0bf 100644 --- a/apps/test-examples/App.js +++ b/apps/test-examples/App.js @@ -8,6 +8,7 @@ import Test111 from './src/Test111'; import Test263 from './src/Test263'; import Test349 from './src/Test349'; import Test364 from './src/Test364'; +import Test432 from './src/Test432'; import Test528 from './src/Test528'; import Test550 from './src/Test550'; import Test556 from './src/Test556'; @@ -84,6 +85,7 @@ import Test1473 from './src/Test1473'; import Test1476 from './src/Test1476'; import Test1509 from './src/Test1509'; import Test1539 from './src/Test1539'; +import Test1645 from './src/Test1645'; import Test1646 from './src/Test1646'; import Test1649 from './src/Test1649'; import Test1671 from './src/Test1671'; diff --git a/apps/test-examples/src/Test1645.js b/apps/test-examples/src/Test1645.js new file mode 100644 index 000000000..ec4a50894 --- /dev/null +++ b/apps/test-examples/src/Test1645.js @@ -0,0 +1,98 @@ +/* eslint-disable react-native/no-inline-styles */ + +import React, {useEffect, useState} from 'react'; +import {Text, View} from 'react-native'; + +import {createBottomTabNavigator} from '@react-navigation/bottom-tabs'; +import {createNativeStackNavigator} from '@react-navigation/native-stack'; +import {createStackNavigator} from '@react-navigation/stack'; +import {NavigationContainer} from '@react-navigation/native'; + +const TestBottomTabBar = createBottomTabNavigator(); +const TestNativeStack1 = createNativeStackNavigator(); +const TestNativeStack2 = createNativeStackNavigator(); + +const TestScreen1 = () => { + const [t, setT] = useState(110); + + useEffect(() => { + const interval = setInterval(() => { + setT(lastT => lastT + 1); + }, 100); + + return () => clearInterval(interval); + }, []); + return ( + + {Array.from({length: 100}).map((e, idx) => ( + + T{idx}: {t} + + ))} + + ); +}; + +const TestScreen2 = () => { + const [t, setT] = useState(0); + + useEffect(() => { + const interval = setInterval(() => { + setT(lastT => lastT + 1); + }, 100); + + return () => clearInterval(interval); + }, []); + + return ( + + {Array.from({length: 100}).map((e, idx) => ( + + T{idx}: {t} + + ))} + + ); +}; +const TestScreenTab1 = () => { + return ( + + + + + ); +}; + +const TestScreenTab2 = () => { + return ( + + + + + ); +}; + +const App = () => { + return ( + + + + + + + ); +}; + +export default App; diff --git a/apps/test-examples/src/Test432.tsx b/apps/test-examples/src/Test432.tsx new file mode 100644 index 000000000..5a0843dbc --- /dev/null +++ b/apps/test-examples/src/Test432.tsx @@ -0,0 +1,72 @@ +import { Pressable, View, Button, Text } from 'react-native'; + +import { NavigationContainer, useNavigation } from '@react-navigation/native'; +import { + NativeStackScreenProps, + createNativeStackNavigator, +} from '@react-navigation/native-stack'; +import React, { useCallback } from 'react'; + +type RootStackParamList = { + Home: undefined; + Settings: undefined; +}; +type RootStackScreenProps = + NativeStackScreenProps; +const HomeScreen = ({ navigation }: RootStackScreenProps<'Home'>) => { + const showSettings = useCallback(() => { + navigation.navigate('Settings'); + }, [navigation]); + return ( + +