SHARE
TWEET

Untitled

a guest May 27th, 2018 80 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import React from 'react'
  2. class Login extends React.Component {
  3. constructor() {
  4.   super()
  5.   this.state = {
  6.    username: '',
  7.    password: ''
  8.   }
  9.  }
  10. handleInputChange = (event) => {
  11.   this.setState({
  12.    [event.target.name]: event.target.value
  13.   })
  14.  }
  15. render() {
  16.   return (
  17.    <form className='login'>
  18.     <label>Username</label>
  19.     <input id='email' onChange={this.handleInputChange} name='email' type='text' />
  20.     <label>Password</label>
  21.     <input id='password' onChange={this.handleInputChange} name='password' type='password' />
  22.     <button>Submit</button>
  23.    </form>
  24.   )
  25.  }
  26. }
  27. export default Login
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top