Guest User

Untitled

a guest
Apr 23rd, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. import React, { Component } from 'react';
  2. import logo from './logo.svg';
  3. import './App.css';
  4.  
  5. class Author extends Component {
  6. fonctionAuClic() {
  7. alert(this.props.name);
  8. }
  9. render() {
  10. return(
  11. <div>
  12. <button onClick={this.fonctionAuClic.bind(this)}>Author
  13. </button>
  14. </div>
  15. );
  16. }
  17. }
  18. class App extends Component {
  19. render() {
  20. return (
  21. <div className="App">
  22. <header className="App-header">
  23. <img src={logo} className="App-logo" alt="logo" />
  24. <h1 className="App-title">Welcome to React</h1>
  25. </header>
  26. <Author name="bob" />
  27. </div>
  28. );
  29. }
  30. }
  31.  
  32.  
  33. export default App;
Add Comment
Please, Sign In to add comment