Skip to content

Commit ede6be8

Browse files
committed
fix: some issues on the nwui template
fix: tsc error
1 parent 9e33b9c commit ede6be8

File tree

5 files changed

+14
-15
lines changed

5 files changed

+14
-15
lines changed

.changeset/loose-hotels-pump.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'create-expo-stack': patch
3+
---
4+
5+
adjustments the nwui template

cli/src/templates/packages/nativewindui/drawer/app/_layout.tsx.ejs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { StatusBar } from 'expo-status-bar';
1212
<% if (props.stylingPackage?.options.selectedComponents.includes('bottom-sheet')) { %>
1313
import { GestureHandlerRootView } from 'react-native-gesture-handler';
1414
<% } %>
15-
15+
import { ComponentProps } from 'react';
1616
import { ThemeToggle } from '~/components/ThemeToggle';
1717
import { useColorScheme, useInitialAndroidBarSync } from '~/lib/useColorScheme';
1818
import { NAV_THEME } from '~/theme';
@@ -61,15 +61,15 @@ export default function RootLayout() {
6161
6262
const SCREEN_OPTIONS = {
6363
animation: 'ios_from_right', // for android
64-
} as const;
64+
} satisfies ComponentProps<typeof Stack>['screenOptions'];
6565
6666
const DRAWER_OPTIONS = {
6767
headerShown: false,
68-
} as const;
68+
} satisfies ComponentProps<typeof Stack.Screen>['options'];
6969
7070
const MODAL_OPTIONS = {
7171
presentation: 'modal',
7272
animation: 'fade_from_bottom', // for android
7373
title: 'Settings',
7474
headerRight: () => <ThemeToggle />,
75-
} as const;
75+
} satisfies ComponentProps<typeof Stack.Screen>['options'];

cli/src/templates/packages/nativewindui/tabs/app/(tabs)/_layout.tsx.ejs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,7 @@ import { TabBarIcon } from '../../components/TabBarIcon';
66

77
export default function TabLayout() {
88
return (
9-
<Tabs
10-
screenOptions={{
11-
tabBarActiveTintColor: 'black',
12-
}}>
9+
<Tabs>
1310
<Tabs.Screen
1411
name='index'
1512
options={{

cli/src/templates/packages/nativewindui/tabs/app/(tabs)/index.tsx.ejs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,8 +264,8 @@ const COMPONENTS: ComponentItem[] = [
264264
name: 'Progress Indicator',
265265
component: function ProgressIndicatorExample() {
266266
const [progress, setProgress] = React.useState(13);
267-
let id: ReturnType<typeof setInterval> | null = null;
268267
React.useEffect(() => {
268+
let id: ReturnType<typeof setInterval> | null = null;
269269
if (!id) {
270270
id = setInterval(() => {
271271
setProgress((prev) => (prev >= 99 ? 0 : prev + 5));
@@ -507,7 +507,7 @@ const COMPONENTS: ComponentItem[] = [
507507
title='Open Bottom Sheet'
508508
onPress={() => bottomSheetModalRef.current?.present()}
509509
/>
510-
<Sheet ref={bottomSheetModalRef} snapPoints={[200]}>
510+
<Sheet ref={bottomSheetModalRef} snapPoints={[200]} enableDynamicSizing={false}>
511511
<View className='flex-1 justify-center items-center pb-8'>
512512
<Text>@gorhom/bottom-sheet 🎉</Text>
513513
</View>

cli/src/templates/packages/react-navigation/navigation/tab-navigator.tsx.ejs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,13 @@ import One from '../screens/one';
55
import Two from '../screens/two';
66

77
const Tab = createBottomTabNavigator({
8+
<% if (props.navigationPackage?.options.type === 'drawer + tabs') { %>
89
screenOptions: function ScreenOptions() {
910
return {
10-
<% if (props.stylingPackage?.name !== "unistyles") { %>
11-
tabBarActiveTintColor: 'black',
12-
<% } %>
13-
<% if (props.navigationPackage?.options.type === 'drawer + tabs') { %>
1411
headerShown: false,
15-
<% } %>
1612
}
1713
},
14+
<% } %>
1815
screens: {
1916
One: {
2017
screen: One,

0 commit comments

Comments
 (0)