Guest User

Untitled

a guest
May 28th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. import React, { Component } from 'react'
  2. import './App.css'
  3.  
  4. import Author from './components/Author.js'
  5.  
  6. class App extends Component {
  7.  
  8. constructor() {
  9. super()
  10. this.state = {
  11. name: ""
  12. }
  13. }
  14. handleClick(){
  15. this.setState({ name: "BOBBY" })
  16. }
  17.  
  18. render() {
  19. return (
  20. <div>
  21. <button onClick={() => this.handleClick() }>Click là</button>
  22. <Author name={this.state.name} />
  23. </div>
  24. )
  25. }
  26. }
  27.  
  28. export default App
Add Comment
Please, Sign In to add comment