Skip to content

Commit a310ec1

Browse files
committed
split lesson
1 parent 1fbb44c commit a310ec1

22 files changed

+19
-5
lines changed

03-jsx.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
<script src="https://unpkg.com/[email protected]/umd/react-dom.development.js"></script>
55
<script src="https://unpkg.com/@babel/[email protected]/babel.js"></script>
66
<script type="text/babel">
7+
const rootElement = document.getElementById('root')
78
const element = <div className="container">Hello World</div>
8-
ReactDOM.render(element, document.getElementById('root'))
9+
ReactDOM.render(element, rootElement)
910
</script>
1011
</body>

04-jsx-tricks.html

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<body>
2+
<div id="root"></div>
3+
<script src="https://unpkg.com/[email protected]/umd/react.development.js"></script>
4+
<script src="https://unpkg.com/[email protected]/umd/react-dom.development.js"></script>
5+
<script src="https://unpkg.com/@babel/[email protected]/babel.js"></script>
6+
<script type="text/babel">
7+
const rootElement = document.getElementById('root')
8+
const children = 'Hello World'
9+
const className = 'container'
10+
const props = {children, className}
11+
const element = <div {...props} />
12+
ReactDOM.render(element, rootElement)
13+
</script>
14+
</body>
File renamed without changes.
File renamed without changes.

06-prop-types.html renamed to 07-prop-types.html

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<body>
22
<div id="root"></div>
3-
<script src="https://unpkg.com/[email protected]/umd/react.development.js"></script>
4-
<script src="https://unpkg.com/[email protected]/umd/react-dom.development.js"></script>
3+
<script src="https://unpkg.com/[email protected]/umd/react.production.min.js"></script>
4+
<script src="https://unpkg.com/[email protected]/umd/react-dom.production.min.js"></script>
55
<script src="https://unpkg.com/@babel/[email protected]/babel.js"></script>
66
<script src="https://unpkg.com/[email protected]/prop-types.js"></script>
77
<script type="text/babel">
@@ -14,13 +14,12 @@
1414
</div>
1515
)
1616
}
17-
1817
SayHello.propTypes = {
1918
firstName: PropTypes.string.isRequired,
2019
lastName: PropTypes.string.isRequired,
2120
}
2221

23-
const element = <SayHello firstName="Sonic" lastName="The Hedgehog" />
22+
const element = <SayHello firstName={false} />
2423

2524
ReactDOM.render(element, rootElement)
2625
</script>
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)