create-expo-stack 2.18.5 → 2.18.6-next.1dd14ce

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/cli.js CHANGED
@@ -33,7 +33,7 @@ function run() {
33
33
  if (!isVersionOk) {
34
34
  console.error(`Error: rn-new requires Node.js version 20.19.0 or higher, or version 22.0.0 or higher.`);
35
35
  console.error(`You are currently running Node.js ${process.versions.node}.`);
36
- console.error('Please update your Node.js version.');
36
+ console.error('Please update your Node version.');
37
37
  process.exit(1);
38
38
  }
39
39
  // enable the following method if you'd like to skip loading one of these core extensions
@@ -46,4 +46,4 @@ function run() {
46
46
  });
47
47
  }
48
48
  exports.run = run;
49
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2xpLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vc3JjL2NsaS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7QUFBQSxxQ0FBZ0M7QUFFaEM7O0dBRUc7QUFDSCxTQUFzQixHQUFHOztRQUN2QixNQUFNLElBQUksR0FBRyxPQUFPLENBQUMsSUFBSSxDQUFDO1FBQzFCLHVCQUF1QjtRQUN2QixNQUFNLEdBQUcsR0FBRyxJQUFBLGVBQUssR0FBRTthQUNoQixLQUFLLENBQUMsbUJBQW1CLENBQUM7YUFDMUIsR0FBRyxDQUFDLFNBQVMsQ0FBQzthQUNkLE9BQU8sQ0FBQyxnQkFBZ0IsRUFBRTtZQUN6QixRQUFRLEVBQUUscUJBQXFCO1lBQy9CLE1BQU0sRUFBRSxJQUFJO1NBQ2IsQ0FBQzthQUNELE9BQU8sRUFBRSxDQUFDLGlEQUFpRDthQUMzRCxNQUFNLEVBQUUsQ0FBQztRQUVaLHFCQUFxQjtRQUNyQixNQUFNLENBQUMsS0FBSyxFQUFFLEtBQUssRUFBRSxNQUFNLENBQUMsR0FBRyxPQ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BRyxDQUFDLEdBQUcsQ0FBQyxJQUFJLENBQUMsQ0FBQztRQUVwQyxxQ0FBcUM7UUFDckMsT0FBTyxPQUFPLENBQUM7SUFDakIsQ0FBQztDQUFBO0FBaENELGtCQWdDQyJ9
@@ -1,4 +1,6 @@
1
- import { StyleSheet, Text, View } from 'react-native';
1
+ import { StyleSheet, View } from 'react-native';
2
+
3
+ import { Text } from '~/components/nativewindui/Text';
2
4
 
3
5
  <% if (props.internalizationPackage?.name === "i18next") { %>
4
6
  import { useTranslation } from 'react-i18next';
@@ -15,11 +17,15 @@ export default function EditScreenInfo({ path }: { path: string }) {
15
17
  <% } %>
16
18
  return (
17
19
  <View style={styles.getStartedContainer}>
18
- <Text style={styles.getStartedText}>{title}</Text>
20
+ <Text variant="heading" className="text-center">
21
+ {title}
22
+ </Text>
19
23
  <View style={[styles.codeHighlightContainer, styles.homeScreenFilename]}>
20
24
  <Text>{path}</Text>
21
25
  </View>
22
- <Text style={styles.getStartedText}>{description}</Text>
26
+ <Text variant="body" className="text-center">
27
+ {description}
28
+ </Text>
23
29
  </View>
24
30
  );
25
31
  }
@@ -33,11 +39,6 @@ const styles = StyleSheet.create({
33
39
  alignItems: 'center',
34
40
  marginHorizontal: 50,
35
41
  },
36
- getStartedText: {
37
- fontSize: 17,
38
- lineHeight: 24,
39
- textAlign: 'center',
40
- },
41
42
  helpContainer: {
42
43
  alignItems: 'center',
43
44
  marginHorizontal: 20,
@@ -1,4 +1,6 @@
1
- import { StyleSheet, Text, View } from 'react-native';
1
+ import { StyleSheet, View } from 'react-native';
2
+
3
+ import { Text } from '~/components/nativewindui/Text';
2
4
 
3
5
  import EditScreenInfo from './EditScreenInfo';
4
6
 
@@ -11,7 +13,9 @@ type ScreenContentProps = {
11
13
  export const ScreenContent = ({ title, path, children }: ScreenContentProps) => {
12
14
  return (
13
15
  <View style={styles.container}>
14
- <Text style={styles.title}>{title}</Text>
16
+ <Text variant="title1" className="text-center">
17
+ {title}
18
+ </Text>
15
19
  <View style={styles.separator} />
16
20
  <EditScreenInfo path={path} />
17
21
  {children}
@@ -31,8 +35,4 @@ const styles = StyleSheet.create({
31
35
  marginVertical: 30,
32
36
  width: '80%',
33
37
  },
34
- title: {
35
- fontSize: 20,
36
- fontWeight: 'bold',
37
- },
38
38
  });
@@ -6,13 +6,20 @@
6
6
  <% } %>
7
7
  <% if (props.stylingPackage?.name === "unistyles") { %>
8
8
  import './unistyles';
9
+ import { DefaultTheme, DarkTheme } from '@react-navigation/native';
10
+ import { useUnistyles } from 'react-native-unistyles';
11
+ import { useMemo } from 'react';
12
+ <% } else if (props.stylingPackage?.name === "tamagui" || props.stylingPackage?.name === "restyle" || props.stylingPackage?.name === "nativewind" || props.stylingPackage?.name === "stylesheet") { %>
13
+ import { DefaultTheme, DarkTheme } from '@react-navigation/native';
14
+ import { useColorScheme } from 'react-native';
15
+ import { useMemo } from 'react';
9
16
  <% } %>
10
17
  <% if (props.internalizationPackage?.name === "i18next") { %>
11
18
  import './translation';
12
19
  <% } %>
13
20
  import "react-native-gesture-handler";
14
21
  <% if (props.stylingPackage?.name === "tamagui") { %>
15
- import React, { useEffect } from "react";
22
+ import React from "react";
16
23
  import { TamaguiProvider } from 'tamagui';
17
24
  import * as SplashScreen from 'expo-splash-screen';
18
25
  import { useFonts } from 'expo-font';
@@ -30,9 +37,9 @@ import "react-native-gesture-handler";
30
37
 
31
38
  vexo(process.env.VEXO_API_KEY); // eslint-disable-line
32
39
 
33
- import RootStack from "./navigation"; // eslint-disable-line
40
+ import Navigation from "./navigation"; // eslint-disable-line
34
41
  <% } else { %>
35
- import RootStack from "./navigation";
42
+ import Navigation from "./navigation";
36
43
  <% } %>
37
44
 
38
45
  export default function App() {
@@ -42,11 +49,8 @@ export default function App() {
42
49
  InterBold: require("@tamagui/font-inter/otf/Inter-Bold.otf"),
43
50
  });
44
51
 
45
- useEffect(() => {
46
- if (loaded) {
47
- SplashScreen.hideAsync();
48
- }
49
- }, [loaded])
52
+ const colorScheme = useColorScheme();
53
+ const theme = useMemo(() => colorScheme === 'dark' ? DarkTheme : DefaultTheme, [colorScheme]);
50
54
 
51
55
  if (!loaded) {
52
56
  return null;
@@ -54,16 +58,43 @@ export default function App() {
54
58
 
55
59
  return (
56
60
  <TamaguiProvider config={config}>
57
- <RootStack />
61
+ <Navigation theme={theme} onReady={() => SplashScreen.hideAsync()} />
58
62
  </TamaguiProvider>
59
63
  );
60
64
  <% } else if (props.stylingPackage?.name === "restyle") { %>
65
+ const colorScheme = useColorScheme();
66
+ const navigationTheme = useMemo(() => colorScheme === 'dark' ? DarkTheme : DefaultTheme, [colorScheme]);
67
+
61
68
  return (
62
69
  <ThemeProvider theme={theme}>
63
- <RootStack />
70
+ <Navigation theme={navigationTheme} />
64
71
  </ThemeProvider>
65
72
  );
73
+ <% } else if (props.stylingPackage?.name === "unistyles") { %>
74
+ const { theme, rt } = useUnistyles();
75
+
76
+ const baseTheme = rt.colorScheme === 'dark' ? DarkTheme : DefaultTheme;
77
+ const mergedTheme = useMemo(() => ({
78
+ ...baseTheme,
79
+ colors: {
80
+ ...baseTheme.colors,
81
+ background: theme.colors.background,
82
+ text: theme.colors.typography,
83
+ primary: theme.colors.astral,
84
+ secondary: theme.colors.cornflowerBlue,
85
+ border: theme.colors.limedSpruce,
86
+ card: theme.colors.background,
87
+ notification: theme.colors.astral,
88
+ },
89
+ }), [baseTheme, theme.colors.background, theme.colors.typography, theme.colors.astral, theme.colors.cornflowerBlue, theme.colors.limedSpruce]);
90
+
91
+ return <Navigation theme={mergedTheme} />;
92
+ <% } else if (props.stylingPackage?.name === "nativewind" || props.stylingPackage?.name === "stylesheet") { %>
93
+ const colorScheme = useColorScheme();
94
+ const theme = useMemo(() => colorScheme === 'dark' ? DarkTheme : DefaultTheme, [colorScheme]);
95
+
96
+ return <Navigation theme={theme} />;
66
97
  <% } else { %>
67
- return <RootStack />;
98
+ return <Navigation />;
68
99
  <% } %>
69
100
  }
@@ -1,66 +1,31 @@
1
1
  import { Ionicons, MaterialIcons } from '@expo/vector-icons';
2
2
  import { createDrawerNavigator } from '@react-navigation/drawer';
3
- import { StackScreenProps } from '@react-navigation/stack';
4
3
  import { HeaderButton } from 'components/HeaderButton';
5
- <% if (props.stylingPackage?.name === "unistyles") { %>
6
- import { useUnistyles } from 'react-native-unistyles';
7
- <% } %>
8
-
9
- import { RootStackParamList } from '.';
10
4
  import TabNavigator from './tab-navigator';
11
5
  import Home from '../screens/home';
12
6
 
13
- type Props = StackScreenProps<RootStackParamList, 'DrawerNavigator'>;
14
-
15
- const Drawer = createDrawerNavigator();
16
7
 
17
- export default function DrawerNavigator({ navigation }: Props) {
18
- <% if (props.stylingPackage?.name === "unistyles") { %>
19
- const { theme } = useUnistyles();
20
- <% } %>
21
-
22
- return (
23
- <% if (props.stylingPackage?.name === "unistyles") { %>
24
- <Drawer.Navigator
25
- screenOptions={{
26
- headerStyle: {
27
- backgroundColor: theme.colors.background,
28
- },
29
- headerTitleStyle: {
30
- color: theme.colors.typography,
31
- },
32
- headerTintColor: theme.colors.typography,
33
- drawerStyle: {
34
- backgroundColor: theme.colors.background,
35
- },
36
- drawerLabelStyle: {
37
- color: theme.colors.typography,
38
- },
39
- drawerInactiveTintColor: theme.colors.typography,
40
- }}
41
- >
42
- <% } else { %>
43
- <Drawer.Navigator>
44
- <% } %>
45
- <Drawer.Screen
46
- name="Home"
47
- component={Home}
48
- options={{
49
- drawerIcon: ({ size, color }) => (
50
- <Ionicons name="home-outline" size={size} color={color} />
51
- ),
52
- }}
53
- />
54
- <Drawer.Screen
55
- name="Tabs"
56
- component={TabNavigator}
57
- options={{
8
+ const Drawer = createDrawerNavigator({
9
+ screens: {
10
+ Home: {
11
+ screen: Home,
12
+ options: {
13
+ drawerIcon: ({ size, color }) => (
14
+ <Ionicons name="home-outline" size={size} color={color} />
15
+ ),
16
+ }
17
+ },
18
+ Tabs: {
19
+ screen: TabNavigator,
20
+ options: ({ navigation })=> ({
58
21
  headerRight: () => <HeaderButton onPress={() => navigation.navigate('Modal')} />,
59
22
  drawerIcon: ({ size, color }) => (
60
23
  <MaterialIcons name="border-bottom" size={size} color={color} />
61
24
  ),
62
- }}
63
- />
64
- </Drawer.Navigator>
65
- );
66
- }
25
+ })
26
+ },
27
+ }
28
+ });
29
+
30
+ export default Drawer;
31
+
@@ -1,156 +1,108 @@
1
1
  <% if (props.navigationPackage?.options.type === 'stack') { %>
2
- import { NavigationContainer } from "@react-navigation/native";
3
- import { createStackNavigator } from "@react-navigation/stack";
4
-
5
- <% if (props.stylingPackage?.name === "unistyles") { %>
6
- import { useUnistyles } from 'react-native-unistyles';
7
- <% } %>
8
-
2
+ import { createStaticNavigation, StaticParamList } from '@react-navigation/native';
3
+ import { createStackNavigator } from '@react-navigation/stack';
9
4
  import Overview from "../screens/overview";
10
5
  import Details from "../screens/details";
11
- import { BackButton } from '../components/BackButton';
6
+ import { BackButton } from '../components/BackButton';
12
7
 
13
- export type RootStackParamList = {
14
- Overview: undefined;
15
- Details: { name: string };
16
- };
8
+ const Stack = createStackNavigator({
9
+ screens: {
10
+ Overview: {
11
+ screen: Overview,
12
+ },
13
+ Details: {
14
+ screen: Details,
15
+ options: ({ navigation }) => ({
16
+ headerLeft: () => <BackButton onPress={navigation.goBack} />,
17
+ })
18
+ },
19
+ }
20
+ });
17
21
 
18
- const Stack = createStackNavigator<RootStackParamList>();
22
+ type RootNavigatorParamList = StaticParamList<typeof Stack>;
19
23
 
20
- export default function RootStack() {
21
- <% if (props.stylingPackage?.name === "unistyles") { %>
22
- const { theme } = useUnistyles();
23
- <% } %>
24
- return (
25
- <NavigationContainer>
26
- <Stack.Navigator
27
- initialRouteName="Overview"
28
- <% if (props.stylingPackage?.name === "unistyles") { %>
29
- screenOptions={{
30
- headerStyle: {
31
- backgroundColor: theme.colors.background,
32
- },
33
- headerTitleStyle: {
34
- color: theme.colors.typography,
35
- },
36
- headerTintColor: theme.colors.typography,
37
- }}
38
- <% } %>
39
- >
40
- <Stack.Screen name="Overview" component={Overview} />
41
- <Stack.Screen
42
- name="Details"
43
- component={Details}
44
- options={({ navigation }) => ({
45
- headerLeft: () => <BackButton onPress={navigation.goBack} />,
46
- })}
47
- />
48
- </Stack.Navigator>
49
- </NavigationContainer>
50
- );
51
- }
24
+ declare global {
25
+ namespace ReactNavigation {
26
+ // eslint-disable-next-line @typescript-eslint/no-empty-object-type
27
+ interface RootParamList extends RootNavigatorParamList {}
28
+ }
29
+ }
30
+
31
+ const Navigation = createStaticNavigation(Stack);
32
+ export default Navigation;
52
33
 
53
34
  <% } else if (props.navigationPackage?.options.type === 'tabs') { %>
54
- import { NavigationContainer } from "@react-navigation/native";
35
+ import { createStaticNavigation, StaticParamList } from '@react-navigation/native';
55
36
  import { createStackNavigator } from "@react-navigation/stack";
56
- <% if (props.stylingPackage?.name === "unistyles") { %>
57
- import { useUnistyles } from 'react-native-unistyles';
58
- <% } %>
59
-
60
37
  import Modal from "../screens/modal";
61
38
  import TabNavigator from "./tab-navigator";
62
39
 
63
- export type RootStackParamList = {
64
- TabNavigator: undefined;
65
- Modal: undefined;
66
- };
67
40
 
68
- const Stack = createStackNavigator<RootStackParamList>();
41
+ const Stack = createStackNavigator({
42
+ screens: {
43
+ TabNavigator: {
44
+ screen: TabNavigator,
45
+ options: {
46
+ headerShown: false,
47
+ },
48
+ },
49
+ Modal: {
50
+ screen: Modal,
51
+ options: {
52
+ presentation: "modal",
53
+ headerLeft: () => null,
54
+ },
55
+ },
56
+ }
57
+ });
69
58
 
70
- export default function RootStack() {
71
- <% if (props.stylingPackage?.name === "unistyles") { %>
72
- const { theme } = useUnistyles();
73
- <% } %>
74
- return (
75
- <NavigationContainer>
76
- <Stack.Navigator
77
- initialRouteName="TabNavigator"
78
- <% if (props.stylingPackage?.name === "unistyles") { %>
79
- screenOptions={{
80
- headerStyle: {
81
- backgroundColor: theme.colors.background,
82
- },
83
- headerTitleStyle: {
84
- color: theme.colors.typography,
85
- },
86
- headerTintColor: theme.colors.typography,
87
- }}
88
- <% } %>
89
- >
90
- <Stack.Screen
91
- name="TabNavigator"
92
- component={TabNavigator}
93
- options={{ headerShown: false }}
94
- />
95
- <Stack.Screen
96
- name="Modal"
97
- component={Modal}
98
- options={{ presentation: "modal", headerLeft: () => null }}
99
- />
100
- </Stack.Navigator>
101
- </NavigationContainer>
102
- );
103
- }
104
- <% } else if (props.navigationPackage?.options.type === 'drawer + tabs') { %>
105
- import { NavigationContainer } from "@react-navigation/native";
106
- import { createStackNavigator } from '@react-navigation/stack';
107
- <% if (props.stylingPackage?.name === "unistyles") { %>
108
- import { useUnistyles } from 'react-native-unistyles';
109
- <% } %>
59
+ type RootNavigatorParamList = StaticParamList<typeof Stack>;
60
+
61
+ declare global {
62
+ namespace ReactNavigation {
63
+ // eslint-disable-next-line @typescript-eslint/no-empty-object-type
64
+ interface RootParamList extends RootNavigatorParamList {}
65
+ }
66
+ }
67
+
68
+ const Navigation = createStaticNavigation(Stack);
69
+ export default Navigation;
110
70
 
71
+ <% } else if (props.navigationPackage?.options.type === 'drawer + tabs') { %>
72
+ import { createStaticNavigation, StaticParamList } from '@react-navigation/native';
73
+ import { createStackNavigator } from '@react-navigation/stack';
111
74
  import Modal from "../screens/modal";
112
75
  import DrawerNavigator from "./drawer-navigator";
113
76
 
114
- export type RootStackParamList = {
115
- DrawerNavigator: undefined;
116
- Modal: undefined;
117
- TabNavigator: undefined;
118
- };
77
+
78
+ const Stack = createStackNavigator({
79
+ screens: {
80
+ DrawerNavigator: {
81
+ screen: DrawerNavigator,
82
+ options: {
83
+ headerShown: false,
84
+ },
85
+ },
86
+ Modal: {
87
+ screen: Modal,
88
+ options: {
89
+ presentation: "modal",
90
+ headerLeft: () => null,
91
+ },
92
+ },
93
+ }
94
+ });
95
+
96
+ type RootNavigatorParamList = StaticParamList<typeof Stack>;
119
97
 
120
- const Stack = createStackNavigator<RootStackParamList>();
98
+ declare global {
99
+ namespace ReactNavigation {
100
+ // eslint-disable-next-line @typescript-eslint/no-empty-object-type
101
+ interface RootParamList extends RootNavigatorParamList {}
102
+ }
103
+ }
121
104
 
122
- export default function RootStack() {
123
- <% if (props.stylingPackage?.name === "unistyles") { %>
124
- const { theme } = useUnistyles();
125
- <% } %>
126
- return (
127
- <NavigationContainer>
128
- <Stack.Navigator
129
- initialRouteName="DrawerNavigator"
130
- <% if (props.stylingPackage?.name === "unistyles") { %>
131
- screenOptions={{
132
- headerStyle: {
133
- backgroundColor: theme.colors.background,
134
- },
135
- headerTitleStyle: {
136
- color: theme.colors.typography,
137
- },
138
- headerTintColor: theme.colors.typography,
139
- }}
140
- <% } %>
141
- >
142
- <Stack.Screen
143
- name="DrawerNavigator"
144
- component={DrawerNavigator}
145
- options={{ headerShown: false }}
146
- />
147
- <Stack.Screen
148
- name="Modal"
149
- component={Modal}
150
- options={{ presentation: "modal", headerLeft: () => null }}
151
- />
152
- </Stack.Navigator>
153
- </NavigationContainer>
154
- );
155
- }
105
+ const Navigation = createStaticNavigation(Stack);
106
+ export default Navigation;
107
+
156
108
  <% } %>
@@ -1,60 +1,38 @@
1
1
  import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
2
- import { StackScreenProps } from '@react-navigation/stack';
3
- <% if (props.stylingPackage?.name === "unistyles") { %>
4
- import { useUnistyles } from 'react-native-unistyles';
5
- <% } %>
6
- import { RootStackParamList } from '.';
7
2
  import { HeaderButton } from '../components/HeaderButton';
8
3
  import { TabBarIcon } from '../components/TabBarIcon';
9
4
  import One from '../screens/one';
10
5
  import Two from '../screens/two';
11
6
 
12
- const Tab = createBottomTabNavigator();
13
-
14
- type Props = StackScreenProps<RootStackParamList, 'TabNavigator'>;
15
-
16
- export default function TabLayout({ navigation }: Props) {
17
- <% if (props.stylingPackage?.name === "unistyles") { %>
18
- const { theme } = useUnistyles();
19
- <% } %>
20
- return (
21
- <Tab.Navigator
22
- screenOptions={{
23
- <% if (props.stylingPackage?.name === "unistyles") { %>
24
- headerStyle: {
25
- backgroundColor: theme.colors.background,
26
- },
27
- headerTitleStyle: {
28
- color: theme.colors.typography,
29
- },
30
- tabBarActiveTintColor: theme.colors.astral,
31
- tabBarStyle: {
32
- backgroundColor: theme.colors.background,
33
- },
34
- <% } else { %>
35
- tabBarActiveTintColor: 'black',
36
- <% } %>
37
- <% if (props.navigationPackage?.options.type === 'drawer + tabs') { %>
7
+ const Tab = createBottomTabNavigator({
8
+ screenOptions: function ScreenOptions() {
9
+ return {
10
+ <% if (props.stylingPackage?.name !== "unistyles") { %>
11
+ tabBarActiveTintColor: 'black',
12
+ <% } %>
13
+ <% if (props.navigationPackage?.options.type === 'drawer + tabs') { %>
38
14
  headerShown: false,
39
15
  <% } %>
40
- }}>
41
- <Tab.Screen
42
- name="One"
43
- component={One}
44
- options={{
45
- title: 'Tab One',
46
- tabBarIcon: ({ color }) => <TabBarIcon name="code" color={color} />,
47
- headerRight: () => <HeaderButton onPress={() => navigation.navigate('Modal')} />,
48
- }}
49
- />
50
- <Tab.Screen
51
- name="Two"
52
- component={Two}
53
- options={{
54
- title: 'Tab Two',
55
- tabBarIcon: ({ color }) => <TabBarIcon name="code" color={color} />,
56
- }}
57
- />
58
- </Tab.Navigator>
59
- );
60
- }
16
+ }
17
+ },
18
+ screens: {
19
+ One: {
20
+ screen: One,
21
+ options: ({ navigation }) => ({
22
+ title: 'Tab One',
23
+ tabBarIcon: ({ color }) => <TabBarIcon name="code" color={color} />,
24
+ headerRight: () => <HeaderButton onPress={() => navigation.navigate('Modal')} />,
25
+ })
26
+ },
27
+ Two: {
28
+ screen: Two,
29
+ options: {
30
+ title: 'Tab Two',
31
+ tabBarIcon: ({ color }) => <TabBarIcon name="code" color={color} />,
32
+ }
33
+ },
34
+ }
35
+ });
36
+
37
+ export default Tab;
38
+
@@ -1,4 +1,4 @@
1
- import { RouteProp, useRoute } from '@react-navigation/native';
1
+ import type { StaticScreenProps } from '@react-navigation/native';
2
2
  import { ScreenContent } from 'components/ScreenContent';
3
3
  <% if (props.stylingPackage?.name === "unistyles") { %>
4
4
  import { View } from 'react-native';
@@ -7,18 +7,16 @@ import { StyleSheet } from 'react-native-unistyles';
7
7
  import { StyleSheet, View } from 'react-native';
8
8
  <% } %>
9
9
 
10
- import { RootStackParamList } from '../navigation';
11
-
12
- type DetailsScreenRouteProp = RouteProp<RootStackParamList, 'Details'>;
13
-
14
- export default function Details() {
15
- const router = useRoute<DetailsScreenRouteProp>();
10
+ type Props = StaticScreenProps<{
11
+ name: string;
12
+ }>;
16
13
 
14
+ export default function Details({ route }: Props) {
17
15
  return (
18
16
  <View style={styles.container}>
19
17
  <ScreenContent
20
18
  path="screens/details.tsx"
21
- title={`Showing details for user ${router.params.name}`}
19
+ title={`Showing details for user ${route.params?.name}`}
22
20
  />
23
21
  </View>
24
22
  );
@@ -1,5 +1,4 @@
1
1
  import { useNavigation } from '@react-navigation/native';
2
- import { StackNavigationProp } from '@react-navigation/stack';
3
2
  import { ScreenContent } from 'components/ScreenContent';
4
3
  <% if (props.stylingPackage?.name === "unistyles") { %>
5
4
  import { View } from 'react-native';
@@ -13,12 +12,9 @@ import { StyleSheet, View } from 'react-native';
13
12
  <% } %>
14
13
 
15
14
  import { Button } from '../components/Button';
16
- import { RootStackParamList } from '../navigation';
17
-
18
- type OverviewScreenNavigationProps = StackNavigationProp<RootStackParamList, 'Overview'>;
19
15
 
20
16
  export default function Overview() {
21
- const navigation = useNavigation<OverviewScreenNavigationProps>();
17
+ const navigation = useNavigation();
22
18
 
23
19
  return (
24
20
  <View style={styles.container}>
package/package.json CHANGED
@@ -1,74 +1,75 @@
1
1
  {
2
- "name": "create-expo-stack",
3
- "version": "2.18.5",
4
- "description": "CLI tool to initialize a React Native application with Expo",
5
- "repository": {
6
- "type": "git",
7
- "url": "https://github.com/roninoss/create-expo-stack.git",
8
- "directory": "cli"
9
- },
10
- "homepage": "https://rn.new",
11
- "license": "MIT",
12
- "types": "build/types/types.d.ts",
13
- "bin": {
14
- "create-expo-stack": "bin/create-expo-stack.js"
15
- },
16
- "files": [
17
- "build",
18
- "LICENSE",
19
- "readme.md",
20
- "docs",
21
- "bin"
22
- ],
23
- "scripts": {
24
- "build": "bun run clean-build && bun run compile && bun run copy-templates && bun run lint-templates",
25
- "bump": "bun run ./src/utilities/bumpVersion.ts",
26
- "clean-build": "rm -rf ./build",
27
- "compile": "tsc -p .",
28
- "copy-templates": "bun run copyfiles -u 2 -a \"./src/templates/**/*\" ./build/templates",
29
- "dev": "bun run build && NODE_ENV=development bun run bin/create-expo-stack.js",
30
- "format": "eslint \"**/*.{js,jsx,ts,tsx}\" --fix --resolve-plugins-relative-to . && prettier \"**/*.{js,jsx,ts,tsx,json}\" --write",
31
- "lint-templates": "bun run ejslint ./src/templates",
32
- "prepublishOnly": "bun run build",
33
- "publishPublic": "bun run build && npm publish --access public",
34
- "snapshot-update": "bun test --bail=1 --timeout 160000 --update-snapshots",
35
- "test:watch": "bun test --watch",
36
- "test": "bun test --bail=1 --timeout 160000",
37
- "test:all": "ALL_PACKAGE_MANAGERS=true bun test --bail=1 --timeout 160000"
38
- },
39
- "prettier": {
40
- "arrowParens": "always",
41
- "bracketSameLine": false,
42
- "bracketSpacing": true,
43
- "printWidth": 120,
44
- "semi": true,
45
- "singleQuote": true,
46
- "tabWidth": 2,
47
- "trailingComma": "none",
48
- "useTabs": false
49
- },
50
- "dependencies": {
51
- "@clack/prompts": "^0.7.0",
52
- "ejs-lint": "^2.0.0",
53
- "expo": "~53.0.6",
54
- "figlet": "^1.6.0",
55
- "gluegun": "latest",
56
- "google-auth-library": "^9.11.0",
57
- "googleapis": "^140.0.0",
58
- "gradient-string": "^2.0.2"
59
- },
60
- "devDependencies": {
61
- "@types/gradient-string": "^1.1.2",
62
- "@typescript-eslint/eslint-plugin": "^6.9.1",
63
- "@typescript-eslint/parser": "^6.9.1",
64
- "copyfiles": "^2.4.1",
65
- "eslint": "^8.53.0",
66
- "eslint-config-prettier": "^9.0.0",
67
- "eslint-plugin-prettier": "^5.0.1",
68
- "husky": "^5.1.3",
69
- "prettier": "^3.1.0"
70
- },
71
- "publishConfig": {
72
- "provenance": false
73
- }
2
+ "name": "create-expo-stack",
3
+ "version": "2.18.6-next.1dd14ce",
4
+ "description": "CLI tool to initialize a React Native application with Expo",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "https://github.com/roninoss/create-expo-stack.git",
8
+ "directory": "cli"
9
+ },
10
+ "homepage": "https://rn.new",
11
+ "license": "MIT",
12
+ "types": "build/types/types.d.ts",
13
+ "bin": {
14
+ "create-expo-stack": "bin/create-expo-stack.js"
15
+ },
16
+ "files": [
17
+ "build",
18
+ "LICENSE",
19
+ "readme.md",
20
+ "docs",
21
+ "bin"
22
+ ],
23
+ "scripts": {
24
+ "build": "bun run clean-build && bun run compile && bun run copy-templates && bun run lint-templates",
25
+ "bump": "bun run ./src/utilities/bumpVersion.ts",
26
+ "clean-build": "rm -rf ./build",
27
+ "compile": "tsc -p .",
28
+ "copy-templates": "bun run copyfiles -u 2 -a \"./src/templates/**/*\" ./build/templates",
29
+ "dev": "bun run build && NODE_ENV=development bun run bin/create-expo-stack.js",
30
+ "format": "eslint \"**/*.{js,jsx,ts,tsx}\" --fix --resolve-plugins-relative-to . && prettier \"**/*.{js,jsx,ts,tsx,json}\" --write",
31
+ "lint-templates": "bun run ejslint ./src/templates",
32
+ "prepublishOnly": "bun run build",
33
+ "publishPublic": "bun run build && npm publish --access public",
34
+ "snapshot-update": "bun test --bail=1 --timeout 160000 --update-snapshots",
35
+ "test:watch": "bun test --watch",
36
+ "test": "bun test --bail=1 --timeout 160000",
37
+ "test:skip-snapshots": "INCLUDE_REACT_NAVIGATION_TESTS=1 SKIP_SNAPSHOTS=1 bun test bun test --bail=1 --timeout 160000",
38
+ "test:all": "ALL_PACKAGE_MANAGERS=true bun test --bail=1 --timeout 160000"
39
+ },
40
+ "prettier": {
41
+ "arrowParens": "always",
42
+ "bracketSameLine": false,
43
+ "bracketSpacing": true,
44
+ "printWidth": 120,
45
+ "semi": true,
46
+ "singleQuote": true,
47
+ "tabWidth": 2,
48
+ "trailingComma": "none",
49
+ "useTabs": false
50
+ },
51
+ "dependencies": {
52
+ "@clack/prompts": "^0.7.0",
53
+ "ejs-lint": "^2.0.0",
54
+ "expo": "~53.0.6",
55
+ "figlet": "^1.6.0",
56
+ "gluegun": "latest",
57
+ "google-auth-library": "^9.11.0",
58
+ "googleapis": "^140.0.0",
59
+ "gradient-string": "^2.0.2"
60
+ },
61
+ "devDependencies": {
62
+ "@types/gradient-string": "^1.1.2",
63
+ "@typescript-eslint/eslint-plugin": "^6.9.1",
64
+ "@typescript-eslint/parser": "^6.9.1",
65
+ "copyfiles": "^2.4.1",
66
+ "eslint": "^8.53.0",
67
+ "eslint-config-prettier": "^9.0.0",
68
+ "eslint-plugin-prettier": "^5.0.1",
69
+ "husky": "^5.1.3",
70
+ "prettier": "^3.1.0"
71
+ },
72
+ "publishConfig": {
73
+ "provenance": false
74
+ }
74
75
  }