For the life of me, I cannot figure out why this little bit of code will not work!
I have isolated the issue to the Button element (the import statement seems fine).
I am seeing the error "Invariant Violation: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. Check the render method of Login.
import React, { ScrollView, Image, StyleSheet, Button } from "react-
native";
import { connect } from "react-redux/native";
const onButtonClicked = () => {};
class Login extends React.Component {
componentDidMount() {}
render() {
return (
<ScrollView
style={{ flex: 1 }}
contentContainerStyle={{
justifyContent: "center",
alignItems: "center"
}}
>
<Image
source={require("../../img/coin.png")}
resizeMode={Image.resizeMode.cover}
style={Styles.coinLogo}
/>
<Button title="Login default" onPress={() => {}} />
</ScrollView>
);
}
}
Login.propTypes = {
dispatch: React.PropTypes.func
};
Login.defaultProps = {
dispatch: () => {}
};
const Styles = StyleSheet.create({
coinLogo: {
marginTop: 50,
height: 200,
width: 200
},
loginButton: {
marginTop: 50
}
});
export default connect(state => ({}))(Login);