-
Notifications
You must be signed in to change notification settings - Fork 234
/
Copy pathindex.html
46 lines (42 loc) · 1.28 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>react-tagsinput</title>
<link rel="stylesheet" href="../react-tagsinput.css">
<style>
#root {
margin: 2rem auto;
max-width: 1024px;
}
</style>
</head>
<body>
<div id="root"></div>
<script crossorigin src="https://unpkg.com/react@18/umd/react.development.js"></script>
<script crossorigin src="https://unpkg.com/react-dom@18/umd/react-dom.development.js"></script>
<script>
window.module = {exports: null};
</script>
<script src="../react-tagsinput.js"></script>
<script type="module">
class Example extends React.Component {
constructor() {
super()
this.state = {tags: []}
}
handleChange = (tags) => {
this.setState({tags})
}
render() {
return React.createElement(ReactTagsInput.default, {value: this.state.tags, onChange: this.handleChange})
}
}
const container = document.getElementById('root')
const root = ReactDOM.createRoot(container)
root.render(React.createElement(Example))
</script>
</body>
</html>