Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Babeless #7

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions components/HelloWorld.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
class HelloWorld extends React.Component {
render() {
return <h1>Hello, World!</h1>
var HelloWorld = React.createClass({
render: function() {
return React.DOM.h1(null, "Hello World!")
}
}
})

window.App.HelloWorld = HelloWorld
7 changes: 3 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
<head>
<meta charset="utf-8" />
<title>React Simple</title>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.8.34/browser.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.8.34/browser-polyfill.js"></script>
<script type="text/javascript" src="https://fb.me/react-0.14.7.js"></script>
<script type="text/javascript" src="https://fb.me/react-dom-0.14.7.js"></script>
<script type="text/javascript">
Expand All @@ -13,7 +11,8 @@
</head>
<body>
<div id="app"></div>
<script type="text/babel" src="./components/HelloWorld.js"></script>
<script type="text/babel" src="./index.js"></script>

<script type="text/javascript" src="./components/HelloWorld.js"></script>
<script type="text/javascript" src="./index.js"></script>
</body>
</html>
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
const { HelloWorld } = window.App
var HelloWorld = window.App.HelloWorld

ReactDOM.render(<HelloWorld />, document.getElementById("app"))
ReactDOM.render(React.createElement(HelloWorld, null), document.getElementById("app"))