Guest User

Untitled

a guest
Oct 16th, 2017
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. import React from 'react';
  2.  
  3. class LoginForm extends React.Component {
  4. constructor() {
  5. super();
  6. this.state = {
  7. username: '',
  8. password: '',
  9. }
  10. this.handleChange = this.handleChange.bind(this);
  11. this.handleSubmit = this.handleSubmit.bind(this);
  12. }
  13. handleChange(event) {
  14. // onChange Event logic
  15. }
  16. handleSubmit(event) {
  17. // onSubmit Event logic
  18. }
  19. render() {
  20. return (
  21. <form> {/* Don't worry about a method or action for now */}
  22. <label htmlFor="username">Username: </label>{/* 'for' is a reserved word in JS, so in JSX we have to use htmlFor */}
  23. <input name="username" type="text" />
  24. <label htmlFor="password">Password: </label>
  25. <input name="password" type="password" />
  26. <button>Submit</button>
  27. </form>
  28. );
  29. }
  30. }
Add Comment
Please, Sign In to add comment