@@ -92,7 +92,7 @@ import { Button, Text, View } from 'react-native';
92
92
import { createNativeStackNavigator } from ' @react-navigation/native-stack' ;
93
93
import { useNavigation } from ' @react-navigation/native' ;
94
94
95
- const Profile = () => {
95
+ const ProfileScreen = () => {
96
96
const navigation = useNavigation ();
97
97
return (
98
98
< View>
@@ -109,7 +109,7 @@ const Profile = () => {
109
109
);
110
110
};
111
111
112
- const Settings = () => {
112
+ const SettingsScreen = () => {
113
113
return (
114
114
< View>
115
115
< Text > Settings Screen< / Text >
@@ -119,8 +119,8 @@ const Settings = () => {
119
119
120
120
export const RootNavigator = createNativeStackNavigator ({
121
121
screens: {
122
- Profile,
123
- Settings,
122
+ Profile: ProfileScreen ,
123
+ Settings: SettingsScreen ,
124
124
},
125
125
});
126
126
```
@@ -132,7 +132,7 @@ export const RootNavigator = createNativeStackNavigator({
132
132
import { Button , Text , View } from ' react-native' ;
133
133
import { createNativeStackNavigator } from ' @react-navigation/native-stack' ;
134
134
135
- const Profile = ({ navigation }) => {
135
+ const ProfileScreen = ({ navigation }) => {
136
136
return (
137
137
< View>
138
138
< Text > Profile Screen< / Text >
@@ -148,7 +148,7 @@ const Profile = ({ navigation }) => {
148
148
);
149
149
};
150
150
151
- const Settings = () => {
151
+ const SettingsScreen = () => {
152
152
return (
153
153
< View>
154
154
< Text > Settings Screen< / Text >
@@ -160,8 +160,8 @@ export const RootNavigator = () => {
160
160
const Stack = createNativeStackNavigator ();
161
161
return (
162
162
< Stack .Navigator >
163
- < Stack .Screen name= " Profile" component= {Profile } / >
164
- < Stack .Screen name= " Settings" component= {Settings } / >
163
+ < Stack .Screen name= " Profile" component= {ProfileScreen } / >
164
+ < Stack .Screen name= " Settings" component= {SettingsScreen } / >
165
165
< / Stack .Navigator >
166
166
);
167
167
};
@@ -320,7 +320,7 @@ import {
320
320
import { fireEvent , render , screen } from ' @testing-library/react-native' ;
321
321
import { Button , Text , View } from ' react-native' ;
322
322
323
- const Profile = () => {
323
+ const ProfileScreen = () => {
324
324
const navigation = useNavigation ();
325
325
return (
326
326
< View>
@@ -335,7 +335,7 @@ const Profile = () => {
335
335
336
336
let renderCounter = 0 ;
337
337
338
- const Settings = () => {
338
+ const SettingsScreen = () => {
339
339
renderCounter++ ;
340
340
return (
341
341
< View>
@@ -346,8 +346,8 @@ const Settings = () => {
346
346
347
347
const Drawer = createDrawerNavigator ({
348
348
screens: {
349
- Profile,
350
- Settings,
349
+ Profile: ProfileScreen ,
350
+ Settings: SettingsScreen ,
351
351
},
352
352
});
353
353
@@ -382,7 +382,7 @@ import {
382
382
import { fireEvent , render , screen } from ' @testing-library/react-native' ;
383
383
import { Button , Text , View } from ' react-native' ;
384
384
385
- const Profile = ({ navigation }) => {
385
+ const ProfileScreen = ({ navigation }) => {
386
386
return (
387
387
< View>
388
388
< Text > Profile Screen< / Text >
@@ -396,7 +396,7 @@ const Profile = ({ navigation }) => {
396
396
397
397
let renderCounter = 0 ;
398
398
399
- const Settings = () => {
399
+ const SettingsScreen = () => {
400
400
renderCounter++ ;
401
401
return (
402
402
< View>
@@ -410,8 +410,8 @@ const Drawer = createDrawerNavigator();
410
410
const DrawerNavigation = () => {
411
411
return (
412
412
< Drawer .Navigator >
413
- < Drawer .Screen name= " Profile" component= {Profile } / >
414
- < Drawer .Screen name= " Settings" component= {Settings } / >
413
+ < Drawer .Screen name= " Profile" component= {ProfileScreen } / >
414
+ < Drawer .Screen name= " Settings" component= {SettingsScreen } / >
415
415
< / Drawer .Navigator >
416
416
);
417
417
};
@@ -455,7 +455,7 @@ import {
455
455
import { act , fireEvent , render , screen } from ' @testing-library/react-native' ;
456
456
import { Button , Text , View } from ' react-native' ;
457
457
458
- const Profile = () => {
458
+ const ProfileScreen = () => {
459
459
const navigation = useNavigation ();
460
460
return (
461
461
< View>
@@ -470,7 +470,7 @@ const Profile = () => {
470
470
471
471
let renderCounter = 0 ;
472
472
473
- const Settings = () => {
473
+ const SettingsScreen = () => {
474
474
renderCounter++ ;
475
475
return (
476
476
< View>
@@ -481,8 +481,8 @@ const Settings = () => {
481
481
482
482
const Drawer = createDrawerNavigator ({
483
483
screens: {
484
- Profile,
485
- Settings,
484
+ Profile: ProfileScreen ,
485
+ Settings: SettingsScreen ,
486
486
},
487
487
});
488
488
@@ -523,7 +523,7 @@ import {
523
523
import { act , fireEvent , render , screen } from ' @testing-library/react-native' ;
524
524
import { Button , Text , View } from ' react-native' ;
525
525
526
- const Profile = ({ navigation }) => {
526
+ const ProfileScreen = ({ navigation }) => {
527
527
return (
528
528
< View>
529
529
< Text > Profile Screen< / Text >
@@ -537,7 +537,7 @@ const Profile = ({ navigation }) => {
537
537
538
538
let renderCounter = 0 ;
539
539
540
- const Settings = () => {
540
+ const SettingsScreen = () => {
541
541
renderCounter++ ;
542
542
return (
543
543
< View>
@@ -551,8 +551,8 @@ const Drawer = createDrawerNavigator();
551
551
const DrawerNavigation = () => {
552
552
return (
553
553
< Drawer .Navigator >
554
- < Drawer .Screen name= " Profile" component= {Profile } / >
555
- < Drawer .Screen name= " Settings" component= {Settings } / >
554
+ < Drawer .Screen name= " Profile" component= {ProfileScreen } / >
555
+ < Drawer .Screen name= " Settings" component= {SettingsScreen } / >
556
556
< / Drawer .Navigator >
557
557
);
558
558
};
@@ -594,7 +594,7 @@ Let's add another button to the Profile screen, which uses `setTimeout`:
594
594
<TabItem value =" static " label =" Static " default >
595
595
596
596
``` js
597
- const Profile = () => {
597
+ const ProfileScreen = () => {
598
598
const navigation = useNavigation ();
599
599
return (
600
600
< View>
@@ -621,7 +621,7 @@ const Profile = () => {
621
621
<TabItem value =" dynamic " label =" Dynamic " >
622
622
623
623
``` js
624
- const Profile = ({ navigation }) => {
624
+ const ProfileScreen = ({ navigation }) => {
625
625
return (
626
626
< View>
627
627
< Text > Profile Screen< / Text >
0 commit comments