There’s no other details after that message,but when I attempt to login/register, I’m seeing the “console.log” pop up successfully. Firebase is also receiving the info as well
Here is my Register.js file
<code>import { StyleSheet, Text, View, Button, TextInput, Alert } from 'react-native';
import { useState } from 'react';
import { getAuth, createUserWithEmailAndPassword } from 'firebase/auth';
import React from 'react';
import LoginPage from './LoginPage';
import { authentication } from './Config';
import { useAuth } from './AuthContext';
export default function RegisterPage({navigation}) {
const [email, setEmail] = useState("");
const [password, setPassword] = useState("");
const [confirmPassword, setConfirmPassword] = useState("");
const {user, setUser}= useAuth();
const signUp = () => {
createUserWithEmailAndPassword(authentication, email, password)
.then((res) => {
console.log('You Have Successfully Created An Account!');
setUser(res.user);
})
.catch((re) => {
console.log(re);
})
}
return (
<View style={styles.container}>
<Text>Welcome! Create Your Account Here</Text>
<TextInput style = {styles.input}
keyboardType='email-address'
placeholder='Please Enter Your E-Mail Here'
placeholderTextColor={'#aa336a'}
value={email}
onChangeText={(text) => setEmail(text)}
/>
<TextInput
style = {styles.input}
placeholder='Please Enter Your Password Here'
placeholderTextColor={'#aa336a'}
secureTextEntry
value={password}
onChangeText={(text) => setPassword(text)}
/>
<TextInput
style = {styles.input}
placeholder='Please Confirm Your Password Here'
placeholderTextColor={'#aa336a'}
secureTextEntry
value={confirmPassword}
onChangeText={(text) => setConfirmPassword(text)}
/>
<Button title='Create An Account' onPress={signUp}></Button>
<Button title='Not Your First Time Here?' onPress={() => navigation.push('Login')}></Button>
</View>
</code>
<code>import { StyleSheet, Text, View, Button, TextInput, Alert } from 'react-native';
import { useState } from 'react';
import { getAuth, createUserWithEmailAndPassword } from 'firebase/auth';
import React from 'react';
import LoginPage from './LoginPage';
import { authentication } from './Config';
import { useAuth } from './AuthContext';
export default function RegisterPage({navigation}) {
const [email, setEmail] = useState("");
const [password, setPassword] = useState("");
const [confirmPassword, setConfirmPassword] = useState("");
const {user, setUser}= useAuth();
const signUp = () => {
createUserWithEmailAndPassword(authentication, email, password)
.then((res) => {
console.log('You Have Successfully Created An Account!');
setUser(res.user);
})
.catch((re) => {
console.log(re);
})
}
return (
<View style={styles.container}>
<Text>Welcome! Create Your Account Here</Text>
<TextInput style = {styles.input}
keyboardType='email-address'
placeholder='Please Enter Your E-Mail Here'
placeholderTextColor={'#aa336a'}
value={email}
onChangeText={(text) => setEmail(text)}
/>
<TextInput
style = {styles.input}
placeholder='Please Enter Your Password Here'
placeholderTextColor={'#aa336a'}
secureTextEntry
value={password}
onChangeText={(text) => setPassword(text)}
/>
<TextInput
style = {styles.input}
placeholder='Please Confirm Your Password Here'
placeholderTextColor={'#aa336a'}
secureTextEntry
value={confirmPassword}
onChangeText={(text) => setConfirmPassword(text)}
/>
<Button title='Create An Account' onPress={signUp}></Button>
<Button title='Not Your First Time Here?' onPress={() => navigation.push('Login')}></Button>
</View>
</code>
import { StyleSheet, Text, View, Button, TextInput, Alert } from 'react-native';
import { useState } from 'react';
import { getAuth, createUserWithEmailAndPassword } from 'firebase/auth';
import React from 'react';
import LoginPage from './LoginPage';
import { authentication } from './Config';
import { useAuth } from './AuthContext';
export default function RegisterPage({navigation}) {
const [email, setEmail] = useState("");
const [password, setPassword] = useState("");
const [confirmPassword, setConfirmPassword] = useState("");
const {user, setUser}= useAuth();
const signUp = () => {
createUserWithEmailAndPassword(authentication, email, password)
.then((res) => {
console.log('You Have Successfully Created An Account!');
setUser(res.user);
})
.catch((re) => {
console.log(re);
})
}
return (
<View style={styles.container}>
<Text>Welcome! Create Your Account Here</Text>
<TextInput style = {styles.input}
keyboardType='email-address'
placeholder='Please Enter Your E-Mail Here'
placeholderTextColor={'#aa336a'}
value={email}
onChangeText={(text) => setEmail(text)}
/>
<TextInput
style = {styles.input}
placeholder='Please Enter Your Password Here'
placeholderTextColor={'#aa336a'}
secureTextEntry
value={password}
onChangeText={(text) => setPassword(text)}
/>
<TextInput
style = {styles.input}
placeholder='Please Confirm Your Password Here'
placeholderTextColor={'#aa336a'}
secureTextEntry
value={confirmPassword}
onChangeText={(text) => setConfirmPassword(text)}
/>
<Button title='Create An Account' onPress={signUp}></Button>
<Button title='Not Your First Time Here?' onPress={() => navigation.push('Login')}></Button>
</View>
);
}
<code>const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#ffb3c6',
alignItems: 'center',
justifyContent: 'center',
},
input: {
width: 340,
height: 57,
backgroundColor: '#d6b4fc',
alignItems:'center',
justifyContent: 'center',
marginTop: 17
},
</code>
<code>const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#ffb3c6',
alignItems: 'center',
justifyContent: 'center',
},
input: {
width: 340,
height: 57,
backgroundColor: '#d6b4fc',
alignItems:'center',
justifyContent: 'center',
marginTop: 17
},
</code>
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#ffb3c6',
alignItems: 'center',
justifyContent: 'center',
},
input: {
width: 340,
height: 57,
backgroundColor: '#d6b4fc',
alignItems:'center',
justifyContent: 'center',
marginTop: 17
},
});
As well As my Login.js
<code>import { StyleSheet, Text, View, Button, Alert, TextInput } from 'react-native';
import { useRef, useState } from 'react'
import { getAuth, signInWithEmailAndPassword } from 'firebase/auth';
import React from 'react';
import RegisterPage from './RegisterPage';
import { authentication } from './Config';
import { useAuth } from './AuthContext';
export default function LoginPage({navigation}) {
const [email, setEmail] = useState("");
const [password, setPassword] = useState("");
const {user, setUser } = useAuth();
const inputRef = useRef();
const passwordRef = useRef();
const signIn = async () => {
signInWithEmailAndPassword(authentication, email, password)
.then ((res) =>{
console.log('You Have Successfully Signed In!');
setUser(res.user);
})
.catch ((err) => {
console.log(err);
setError('Error In Signing In')
})
};
return (
<View style={styles.container}>
<Text>Welcome Back! Please Sign In</Text>
<TextInput
ref={inputRef}
style={styles.input}
placeholder='Please Enter Your E-Mail Here'
keyboardType='email-address'
placeholderTextColor={'#aa336a'}
value={email}
onChangeText={(email) => setEmail(email)}
/>
<TextInput
ref={passwordRef}
style= {styles.input}
placeholder='Please Enter Your Password Here'
placeholderTextColor={'#aa336a'}
value={password}
secureTextEntry
onChangeText={(text) => setPassword(text)}
/>
<Button title='Login' onPress={signIn}></Button>
<Button title='First Time Here?'onPress={() => navigation.push('Register')}></Button>
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#fff',
alignItems: 'center',
justifyContent: 'center',
},
input: {
width: 340,
height: 57,
backgroundColor: '#d6b4fc',
justifyContent: 'center',
alignItems: 'center',
marginTop: 17
},
});
</code>
<code>import { StyleSheet, Text, View, Button, Alert, TextInput } from 'react-native';
import { useRef, useState } from 'react'
import { getAuth, signInWithEmailAndPassword } from 'firebase/auth';
import React from 'react';
import RegisterPage from './RegisterPage';
import { authentication } from './Config';
import { useAuth } from './AuthContext';
export default function LoginPage({navigation}) {
const [email, setEmail] = useState("");
const [password, setPassword] = useState("");
const {user, setUser } = useAuth();
const inputRef = useRef();
const passwordRef = useRef();
const signIn = async () => {
signInWithEmailAndPassword(authentication, email, password)
.then ((res) =>{
console.log('You Have Successfully Signed In!');
setUser(res.user);
})
.catch ((err) => {
console.log(err);
setError('Error In Signing In')
})
};
return (
<View style={styles.container}>
<Text>Welcome Back! Please Sign In</Text>
<TextInput
ref={inputRef}
style={styles.input}
placeholder='Please Enter Your E-Mail Here'
keyboardType='email-address'
placeholderTextColor={'#aa336a'}
value={email}
onChangeText={(email) => setEmail(email)}
/>
<TextInput
ref={passwordRef}
style= {styles.input}
placeholder='Please Enter Your Password Here'
placeholderTextColor={'#aa336a'}
value={password}
secureTextEntry
onChangeText={(text) => setPassword(text)}
/>
<Button title='Login' onPress={signIn}></Button>
<Button title='First Time Here?'onPress={() => navigation.push('Register')}></Button>
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#fff',
alignItems: 'center',
justifyContent: 'center',
},
input: {
width: 340,
height: 57,
backgroundColor: '#d6b4fc',
justifyContent: 'center',
alignItems: 'center',
marginTop: 17
},
});
</code>
import { StyleSheet, Text, View, Button, Alert, TextInput } from 'react-native';
import { useRef, useState } from 'react'
import { getAuth, signInWithEmailAndPassword } from 'firebase/auth';
import React from 'react';
import RegisterPage from './RegisterPage';
import { authentication } from './Config';
import { useAuth } from './AuthContext';
export default function LoginPage({navigation}) {
const [email, setEmail] = useState("");
const [password, setPassword] = useState("");
const {user, setUser } = useAuth();
const inputRef = useRef();
const passwordRef = useRef();
const signIn = async () => {
signInWithEmailAndPassword(authentication, email, password)
.then ((res) =>{
console.log('You Have Successfully Signed In!');
setUser(res.user);
})
.catch ((err) => {
console.log(err);
setError('Error In Signing In')
})
};
return (
<View style={styles.container}>
<Text>Welcome Back! Please Sign In</Text>
<TextInput
ref={inputRef}
style={styles.input}
placeholder='Please Enter Your E-Mail Here'
keyboardType='email-address'
placeholderTextColor={'#aa336a'}
value={email}
onChangeText={(email) => setEmail(email)}
/>
<TextInput
ref={passwordRef}
style= {styles.input}
placeholder='Please Enter Your Password Here'
placeholderTextColor={'#aa336a'}
value={password}
secureTextEntry
onChangeText={(text) => setPassword(text)}
/>
<Button title='Login' onPress={signIn}></Button>
<Button title='First Time Here?'onPress={() => navigation.push('Register')}></Button>
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#fff',
alignItems: 'center',
justifyContent: 'center',
},
input: {
width: 340,
height: 57,
backgroundColor: '#d6b4fc',
justifyContent: 'center',
alignItems: 'center',
marginTop: 17
},
});
I tried turning the curly brackets into an array, but that caused an error that wouldn’t cause the page to load