forked from shakacode/react-webpack-rails-tutorial
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample.jsx
executable file
·36 lines (32 loc) · 918 Bytes
/
example.jsx
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
var React = require('react/addons');
import { CommentBox } from './CommentBox';
var $ = require('jquery');
var render = () => {
if ($("#content").length > 0) {
React.render(
<div>
<CommentBox url="comments.json" pollInterval={2000} />
<div className="container">
<a href="http://www.railsonmaui.com">
<h3 className="open-sans-light">
<div className="logo"/>
Example of styling using image-url and Open Sans Light custom font
</h3>
</a>
<a href="https://twitter.com/railsonmaui">
<div className="twitter-image"/>
Rails On Maui on Twitter
</a>
</div>
</div>,
document.getElementById('content')
);
}
};
$(function() {
render();
// Next part is to make this work with turbo-links
$(document).on("page:change", () => {
render();
});
});