Skip to content

Instantly share code, notes, and snippets.

@tpetrina
Last active September 26, 2017 14:37
Show Gist options
  • Save tpetrina/b339083570cb859cc2d54293b37f139a to your computer and use it in GitHub Desktop.
Save tpetrina/b339083570cb859cc2d54293b37f139a to your computer and use it in GitHub Desktop.
React form complication 2
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