Advertisement
Guest User

Untitled

a guest
Dec 13th, 2019
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. import React, { useState } from 'react';
  2. import { Form } from 'react-bootstrap';
  3.  
  4. const Login = () => {
  5. const [ form, setForm ] = useState({
  6. username: '',
  7. password: ''
  8. });
  9.  
  10. const onChange = (event) => {
  11. const { name, value } = event.target;
  12. setForm(form => {
  13. form[name] = value;
  14. return form;
  15. });
  16. }
  17.  
  18. return (
  19. <Form.Group>
  20. <Form.Label><strong>Username</strong></Form.Label>
  21. <Form.Control
  22. type="text"
  23. name="username"
  24. value={form.username}
  25. spellCheck={false}
  26. onChange={onChange}
  27. />
  28. </Form.Group>
  29. )
  30. }
  31.  
  32. export default Login;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement