Skip to content

Commit 869998a

Browse files
Create client.js and load bundle script in Component
- Render/mount the Component to the document node with ReactDOM (`client.js` is the entry point for the webpack bundle) - Then make sure to load the `bundle.js` script in the Component
1 parent eebb990 commit 869998a

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

Component.jsx

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ module.exports = React.createClass({
1717
<p>Isn't server-side rendering remarkable?</p>
1818
<button onClick={this._handleClick}>Click Me</button>
1919
</div>
20+
<script src='/bundle.js' />
2021
</body>
2122
</html>
2223
);

client.js

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
var React = require('react');
2+
var ReactDOM = require('react-dom');
3+
var Component = require('./Component.jsx');
4+
5+
ReactDOM.render(
6+
React.createElement(Component), document
7+
);

0 commit comments

Comments
 (0)