Skip to content

Latest commit

 

History

History
35 lines (28 loc) · 666 Bytes

virtualdom.md

File metadata and controls

35 lines (28 loc) · 666 Bytes

Virtual DOM

index.html

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>React Demo</title>
</head>
<body>
    <div id="container" class='container'></div>
</body>
<script src='bundle.js'></script>
</html>

app.jsx

'use strict';
var React = require('react');
var ReactDOM = require('react-dom');

var Hello = React.createClass({
    render : function(){
        return (
            <p>Hello world!</p>
        );
    }
});
ReactDOM.render(
    <Hello />,
    document.getElementById('container'));

秘密都隱藏在 bundle.js裡