Skip to content

Instantly share code, notes, and snippets.

@muhibbudins
Created March 26, 2018 01:09
Show Gist options
  • Save muhibbudins/c15b168165e32a91759f56248ce9e812 to your computer and use it in GitHub Desktop.
Save muhibbudins/c15b168165e32a91759f56248ce9e812 to your computer and use it in GitHub Desktop.
App.js file for my tutorial
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