Reputation: 47871
Getting the error elment type is invalid: expected a string (for built in components) or a class/function (for composite comonents) but got: undefined
My render function is pretty basic - what am I doing wrong in declaring and rendering the react-native button?
render() {
const { dispatch, isAuthenticated, errorMessage, username } = this.props;
return (
<View style={styles.outer}>
{ isAuthenticated ? (
<Button title="Logout" />
) : (
<Button title="Login" />
)}
</View>
);
}
};
Upvotes: 2
Views: 463
Reputation: 8678
The default Button component was introduced only in 0.37 version. https://github.com/facebook/react-native/releases/tag/v0.37.0
Upvotes: 1
Reputation: 8936
Don't forget the brackets -> title={"Logout"}, title={"Login"}
Edit: nvm, looks like you dont need them for react-native button.
What if you tried something like:
<View style={styles.outer}>
<Button title={isAuthenticated ? "Logout" : "Login"} />
<View />
Upvotes: 0