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