1import React from 'react'; const App = () => { const greeting = 'Hello Function Component!'; return <Headline value={greeting} />;}; const Headline = ({ value }) => <h1>{value}</h1>; export default App;
1// it a component
2import React from 'react';
3
4class App extends React.Component {
5 //call function (ECMAScript 5) from tag input:text
6 handleChange = e => {
7 //
8 console.log(`${e.target.value}`)
9 }
10 render() {
11 return (
12 <div className="App">
13 <input type="text" name="input" id="" placeholder="" onChange={this.handleChange}/>
14 </div>
15 );
16}
17}
18
19export default App;