Reputation: 393
When i run my app on the ios simulator, it works without crashing. But when i run it on the android simulator, expo downloads JS bundle but after 2-3 seconds (on the expo loading), it crashes, returning me on the android home...
App.js :
import React from 'react';
import { Text, View, SafeAreaView } from 'react-native';
const App = () => {
return (
<View
style={{
flex: 1,
justifyContent: 'Center',
alignItems: 'Center',
backgroundColor: 'rgb(255,255,255)',
}}>
<Text
style={{
color: 'rgb(44,44,44)',
textAlign: 'center',
width: '100%',
}}>
Hello World!
</Text>
</View>
);
};
export default App;
Thanks!
Upvotes: 1
Views: 696
Reputation: 2478
Use lowercase value of strings in style.
import React from 'react';
import { Text, View, SafeAreaView } from 'react-native';
const App = () => {
return (
<View
style={{
flex: 1,
justifyContent: 'center', // <-- fixed
alignItems: 'center', // <-- fixed
backgroundColor: 'rgb(255,255,255)',
}}>
<Text
style={{
color: 'rgb(44,44,44)',
textAlign: 'center',
width: '100%',
}}>
Hello World!
</Text>
</View>
);
};
export default App;
Upvotes: 3