I have one file with RN Component PageRegistration:
const { registerUser } = require('../../db/db');
export default class PageRegistration extends Component {
constructor(props) {
super(props);
this.state = {
...
}
}
regUser = () => {
...
registerUser(user);
}
render() {
return(
<View style = {pageRegistrationStyle.container}>
...
<TouchableOpacity onPress = {this.regUser}
style = {pageRegistrationStyle.registrButton}>
<Text style = {pageRegistrationStyle.registrButtonText}>
ADD USER
</Text>
</TouchableOpacity>
</View>
)
}
}
and one more file db:
const firebase = require("firebase");
const config = {
...
};
firebase.initializeApp(config);
const db = firebase.database();
const registerUser = (user) => {
db.ref('userData').set({
...
});
};
export default registerUser;
For some reason when I import function registerUser() from db file to the file PageRegistration I get an error "Objects are not valid as a React child (found: object with keys ($$typeof, type, key, ref ...). If you mean to render a collection of children, use an array instead."
What's wrong? What did I missed? Can someone, please, help me?
Edition:
It seems like the issue is related to the content of db file. In particular - first row with import of firebase