I demoed React Native as an example of a login application, including two files App.js and Login.js. Please help me pick them up. When running, I get an error: Render error: Text strings must be rendered within a
file App.js
import React from 'react';
import { StyleSheet, View } from 'react-native';
import Login from './Login'; // Import component Login
const App = () => {
return (
{/* Use component Login */}
);
};
export default App;
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#e7feff',
},
});
file Login.js
import { StyleSheet, View, TextInput, Text, Image, Alert, TouchableOpacity } from 'react-native';
const Login = () => {
return (
);
};
export default Login;
const styles = StyleSheet.create({
});
Dong Lam TrienPosted Jun 11, 2024, 9:36 AM
I removed the semi-colon in the style container still giving the above error
Vishal JoshiPosted Jun 11, 2024, 9:28 AM
Hello,
Remove the semi-colon in the style container.
Thanks