Created
March 26, 2018 01:09
-
-
Save hibuno/c15b168165e32a91759f56248ce9e812 to your computer and use it in GitHub Desktop.
App.js file for my tutorial
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
import HelloWorld from './pagedraw/hello_world' | |
import './App.css' | |
class App extends Component { | |
constructor() { | |
super(); | |
this.state = { | |
fullname: '' | |
} | |
this.handleChange = this.handleChange.bind(this); | |
this.handleClick = this.handleClick.bind(this); | |
} | |
handleChange(evt) { | |
this.setState({fullname: evt.target.value}); | |
} | |
handleClick() { | |
alert(this.state.fullname) | |
} | |
render() { | |
return ( | |
<HelloWorld | |
handleChange={this.handleChange} | |
handleClick={this.handleClick} | |
/> | |
); | |
} | |
} | |
export default App; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment