Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var Login = React.createClass({
- getInitialState: ()=> {
- console.log("Login getInitialState");
- return {
- username: '',
- password: ''
- }
- },
- handleUsernameOnChange: function (e) {
- this.setState({username: e.target.value});
- }, handlePasswordOnChange: function (e) {
- this.setState({password: e.target.value});
- }, handleSubmit: function (e) {
- }, render: function () {
- return (
- <div style={{padding:100}}><center>
- <form onSubmit={this.handleSubmit} action='app.html' method="get">
- <input type="text" placeholder="Username" value={this.state.username}
- onChange={this.handleUsernameOnChange}/>
- <br/>
- <input type="password" placeholder="Password" value={this.state.password}
- onChange={this.handlePasswordOnChange}/>
- <br/>
- <input type="submit" value="Login"/>
- </form>
- </center>
- </div>
- );
- }
- });
- ReactDOM.render(
- <Login/>,
- document.getElementById('login')
- );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement