-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path05_fragments.html
More file actions
25 lines (24 loc) · 899 Bytes
/
Copy path05_fragments.html
File metadata and controls
25 lines (24 loc) · 899 Bytes
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
<script src="https://unpkg.com/react@16.12.0/umd/react.development.js"></script>
<script src="https://unpkg.com/react-dom@16.12.0/umd/react-dom.development.js"></script>
<script src="https://unpkg.com/@babel/standalone@7.8.3/babel.js"></script>
<body>
<div id="root">
</div>
</body>
<script type="text/babel">
const rootElement = document.getElementById('root')
const children1 = 'Hello'
const children2 = 'BTS'
const className = 'container'
const props1 = {children: children1, className}
const props2 = {children: children2, className}
// const element = <React.Fragment>
// <h1 {...props1}/>
// <h1 {...props2} className="not-container"/>
// </React.Fragment>
const element = (
<>
<span {...props1}/> <span {...props2} className="not-container"/>
</>)
ReactDOM.render(element, rootElement)
</script>