-
Notifications
You must be signed in to change notification settings - Fork 10
/
browser.html
40 lines (35 loc) · 1.08 KB
/
browser.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Recollect test</title>
</head>
<body>
<div id="app"></div>
<script src="https://unpkg.com/react@16.13.1/umd/react.production.min.js"></script>
<script src="https://unpkg.com/react-dom@16.13.1/umd/react-dom.production.min.js"></script>
<script src="https://unpkg.com/babel-standalone@6.26.0/babel.min.js"></script>
<script src="https://unpkg.com/react-recollect@5.2.2/dist/umd/index.production.js"></script>
<!--Uncomment the below for local testing-->
<!--<script src="/dist/umd/index.development.js"></script>-->
<script type="text/babel">
ReactRecollect.initStore({
title: 'Hello, people that load npm packages in a script tag',
counter: 0,
});
const App = ReactRecollect.collect(({store}) => (
<React.Fragment>
<h1>{store.title}</h1>
<p>Click count: {store.counter}</p>
<button
onClick={() => {
store.counter++;
}}>
Increment
</button>
</React.Fragment>
));
ReactDOM.render(<App/>, document.getElementById('app'));
</script>
</body>
</html>