Guest User

Untitled

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