Issue
Im using expo for my app, when I'm using expo emulator all works fine, but when I'm trying to build it, it gives me white screen (I have also added some alerts to find out is it going into component, but it's not)
import React, {useEffect} from "react";
import {Text, View} from "react-native";
import Test from "./Test.js";
import { createNativeStackNavigator } from '@react-navigation/native-stack';
const Stack = createNativeStackNavigator();
function TestSecond() {
useEffect(() => {
alert('testFirst')
}, [])
return (
<Text>test First</Text>
)
}
export default function TestFirst() {
return (
<View style={{flex: 1}}>
<NavigationContainer>
<Stack.Navigator>
<Stack.Screen name="Test" component={Test} />
<Stack.Screen name="Test2" component={TestSecond}/>
</Stack.Navigator>
</NavigationContainer>
</View>
);
}
Im pretty confused what's wrong with this..
Solution
Well, I've found out what I was missing, maybe it will help somebody - all I had to do was add import 'react-native-gesture-handler';
on TestFirst component.
Answered By - Paweł
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.