I am currently developing an application with React Native. The basis was Ignite. At the moment, very often when I start the application, I get an error message that I do not un
I noticed that this happens when you declare variables or properties after exporting your component. For example if you do the following:
export default SignInLayout extends React.Component {
render() {
}
}
const styles = Stylesheet.create({
red: {
color: red
}
});
You get the error Trying to add a root view with an explicit id already set
.
To fix this, either move your variable declarations up, before exporting your component. Or You can still keep your variable declarations at the bottom by changing the above code to only export the component at the end.
SignInLayout extends React.Component {
render() {
}
}
const styles = Stylesheet.create({
red: {
color: red
}
});
export default SignInLayout;