Created
January 14, 2019 07:51
-
-
Save thomashagstrom/79f098c008cbc3d1801db59ce1490776 to your computer and use it in GitHub Desktop.
React component with arrow function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class CognitoLogin extends React.Component< | |
ICognitoLoginProps, | |
ICognitoLoginState | |
> { | |
constructor(props: ICognitoLoginProps) { | |
super(props); | |
this.state = { | |
userInput: __DEV__ | |
? { | |
email: 'cogtest@mailinator.com', | |
password: 'Password1#', | |
phone: '+46730555252', | |
} | |
: { email: undefined, password: undefined }, | |
}; | |
} | |
onEmailChanged = (email: string | undefined) => { | |
const { userInput } = this.state; | |
if (_.isNil(email)) { | |
return; | |
} | |
userInput.email = email; | |
this.setState({ userInput }); | |
} | |
render(){} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment