-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.jsx
More file actions
45 lines (38 loc) · 1.22 KB
/
Copy pathApp.jsx
File metadata and controls
45 lines (38 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import React from 'react';
import { Header } from "./components/Header";
import { Home } from "./components/Home";
class App extends React.Component {
constructor() {
super();
this.state = {
homeLink: "Home"
};
}
onGreet() {
alert('Hello');
}
onChangeLinkName(newName) {
this.setState({
homeLink: newName
});
}
render() {
var hobbies = ["Football", "Programming", "Music"];
return (
<div className="container">
<div className="row">
<div className="col-xs-10 col-xs-offest-1">
<h1>{this.state.homeLink}</h1>
</div>
</div>
<div className="row">
<div className="col-xs-10 col-xs-offest-1">
<Header homeLink="Home"/>
<Home hobbies={hobbies} name={"Cristi"} initialAge={27} greet={this.onGreet} changeLink={this.onChangeLinkName.bind(this)} initialHomeLink={this.state.homeLink}/>
</div>
</div>
</div>
);
}
}
export default App;