-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample-react.html
More file actions
42 lines (34 loc) · 962 Bytes
/
example-react.html
File metadata and controls
42 lines (34 loc) · 962 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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<!--
BBH ♥ Babel Browser Harness
In-browser CDN-based ES6+ transpiling via Babel
Copyright (c) 2016, Michael Spencer
MIT License
-->
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Babel Browser Harness</title>
<script src="./bbh.js"></script>
</head>
<body>
<div id="app">
<!------------------------>
<!-- ♦ YOUR CODE HERE ♦ -->
<!------------------------>
<!-- Example (using React) -->
<script type="text/babel" name="react-example">
import React from 'react'
import { render } from 'react-dom'
import { welcome } from './bbh'
render(<div>{ welcome }</div>, document.getElementById('app'))
</script>
</div>
<!--------------------------------->
<!-- ♥ CONFIGURATION FOR REACT ♥ -->
<!--------------------------------->
<script>
bbh.babelConfig = { presets: ['es2015', 'react'] };
</script>
</body>
</html>