-
-
Notifications
You must be signed in to change notification settings - Fork 108
Open
Description
Right now component exports are something like this
import { View } from '@rn-primitives/slot';
import { Stack } from 'expo-router';
import { Container } from '~/components/Container';
import { Text } from '~/components/nativewindui/Text';
import { ScreenContent } from '~/components/ScreenContent';
export default function Home() {
return (
<>
<Stack.Screen options={{ title: 'Tab Two' }} />
<Container>
<View className="flex-1 items-center justify-center bg-green-400">
<Text>Tab Two</Text>
</View>
</Container>
</>
);
}Because we are exporting inline. App goes back to the initial screen when using fast refresh
reason you can see this in thread expo/router#455
So if we could make the export defination like this. Then it would not go to the initial screen after every fast refresh
import { View } from '@rn-primitives/slot';
import { Stack } from 'expo-router';
import { Container } from '~/components/Container';
import { Text } from '~/components/nativewindui/Text';
import { ScreenContent } from '~/components/ScreenContent';
function Home() {
return (
<>
<Stack.Screen options={{ title: 'Tab Two' }} />
<Container>
<View className="flex-1 items-center justify-center bg-green-400">
<Text>Tab Two</Text>
</View>
</Container>
</>
);
}
export default Home;Metadata
Metadata
Assignees
Labels
No labels