/
index.html
54 lines (46 loc) · 1.21 KB
/
index.html
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
46
47
48
49
50
51
52
53
54
<html>
<head>
<meta charset="UTF-8" />
<title>My First Bloc App</title>
<script src="https://fb.me/react-0.14.3.js"></script>
<script src="https://fb.me/react-dom-0.14.3.js"></script>
<script src="https://unpkg.com/babel-standalone@6.15.0/babel.min.js"></script>
<script type="text/babel" src="js/app.js"></script>
<link rel="stylesheet" href="css/app.css">
</head>
<body>
<div id="root"></div>
<script type="text/babel">
class App extends React.Component {
constructor(props) {
super(props);
this.state = {
items: [{text: "Immutable Inner text"}]
};
}
render() {
return (
<div>
<h2>Welcome to this page {this.props.name}</h2>
<img src={this.props.image} alt="This Image"/>
<p>{this.state.items[0].text}</p>
<p>Create: {this.props.product}</p>
</div>
);
}
}
const info = {
name: "New User",
image: "https://s-media-cache-ak0.pinimg.com/originals/6f/bd/29/6fbd29d69d71bfb2ffe3808dfc348ddb.jpg",
product: "New Account",
}
ReactDOM.render(
<App
name={info.name}
image={info.image}
product={info.product}/>,
document.getElementById('root')
);
</script>
</body>
</html>