Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import React, { Component } from 'react';
- class Author extends Component{
- fonctionAuClic() {
- alert(this.props.name);
- }
- render(){
- return(
- <div>
- <button onClick={this.fonctionAuClic.bind(this)}>
- Clic
- </button>
- </div>
- );
- }
- }
- class App extends Component {
- render() {
- return (
- <div>
- <Author name ="bob"/>
- </div>
- );
- }
- }
- export default App;
Add Comment
Please, Sign In to add comment