Created
April 17, 2018 07:33
-
-
Save soner8/ce94317e9071d4bdc602c3714fd13e87 to your computer and use it in GitHub Desktop.
Author
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
import ReactDOM from 'react-dom'; | |
import logo from './logo.svg'; | |
import './App.css'; | |
import Author from './test'; | |
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> | |
<p className="App-intro"> | |
To get started, edit <code>src/App.js</code> and save to reload. | |
</p> | |
</div> | |
); | |
} | |
} | |
ReactDOM.render(<Author name='bob' />, document.getElementById('root')); | |
export default App; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, {Component} from 'react'; | |
import logo from './logo.svg'; | |
import './App.css'; | |
class Author extends Component { | |
fonctionAuClic() { | |
console.log('clic'); | |
alert(this.props.name); | |
} | |
render() { | |
return( | |
<div onClick={this.fonctionAuClic.bind(this)}> | |
{this.props.maprop} | |
<p>Salut</p> | |
</div> | |
); | |
} | |
} | |
export default Author; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment