Skip to content

Commit c8cac1c

Browse files
committed
rails g react:component post title body --es6
1 parent 7a13fa1 commit c8cac1c

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

app/javascript/components/Post.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
var React = require("react")
2+
class Post extends React.Component {
3+
render () {
4+
return (
5+
<div>
6+
<div>Title: {this.props.title}</div>
7+
<div>Body: {this.props.body}</div>
8+
</div>
9+
);
10+
}
11+
}
12+
13+
Post.propTypes = {
14+
title: React.PropTypes.node,
15+
body: React.PropTypes.node
16+
};
17+
module.exports = Post

0 commit comments

Comments
 (0)