-
Notifications
You must be signed in to change notification settings - Fork 0
/
3_Props.txt
42 lines (36 loc) · 1005 Bytes
/
3_Props.txt
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
<!DOCTYPE html>
<html>
<head>
<title>React project</title>
<script src = "https://unpkg.com/react@16.7.0/umd/react.development.js"></script>
<script src = "https://unpkg.com/react-dom@16.7.0/umd/react-dom.development.js"></script>
<script src = "https://unpkg.com/@babel/standalone/babel.min.js"></script>
<style>
#heading {
color: pink;
}
.heading {
color: red;
}
</style>
</head>
<body>
<div id="root"></div>
<script type="text/babel">
const Hello = (props) => {
console.log(props);
return (
<div className = "heading">
<h1>Welcome to {props.library}</h1>
<p>{props.message}</p>
</div>
)
};
ReactDOM.render(
<Hello library = "React" message="Enjoy!"/>,
document.getElementById("root")
);
</script>
</body>
</html>
#props: display dynamic data within a component