Last active
September 26, 2017 14:37
-
-
Save tpetrina/b339083570cb859cc2d54293b37f139a to your computer and use it in GitHub Desktop.
React form complication 2
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
const RegisterForm = ({ | |
username, password, isRegistering, | |
onRegister, set | |
}) => ( | |
<div> | |
<h1>Register</h1> | |
<div> | |
<label>Username</label> | |
<input type="text" name="username" value={username} onChange={set} | |
/> | |
</div> | |
<div> | |
<label>Password</label> | |
<input type="password" name="password" value={password} onChange={set} /> | |
</div> | |
{isRegistering ? "registering..." : false} | |
<div> | |
<button onClick={onRegister} disabled={isRegistering}> | |
register | |
</button> | |
</div> | |
</div> | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment