File tree Expand file tree Collapse file tree 1 file changed +11
-10
lines changed Expand file tree Collapse file tree 1 file changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -218,7 +218,6 @@ rails generate react:component Post title:string body:string published:bool publ
218218would generate the following in ` app/assets/javascripts/components/post.js.jsx ` :
219219
220220``` jsx
221- /** @jsx React.DOM */
222221var Post = React .createClass ({
223222 propTypes: {
224223 title: React .PropTypes .string ,
@@ -228,26 +227,28 @@ var Post = React.createClass({
228227 },
229228
230229 render : function () {
231- return < div>
232- < div> Title: {this .props .title }< / div>
233- < div> Body: {this .props .body }< / div>
234- < div> Published: {this .props .published }< / div>
235- < div> Published By: {this .props .published_by }< / div>
236- < / div> ;
230+ return (
231+ < div>
232+ < div> Title: {this .props .title }< / div>
233+ < div> Body: {this .props .body }< / div>
234+ < div> Published: {this .props .published }< / div>
235+ < div> Published By: {this .props .published_by }< / div>
236+ < / div>
237+ );
237238 }
238- })
239+ });
239240```
240241
241242The generator can use the following arguments to create basic propTypes:
242243
243244 * any
244245 * array
245246 * bool
246- * component
247+ * element
247248 * func
248249 * number
249250 * object
250- * renderable
251+ * node
251252 * shape
252253 * string
253254
You can’t perform that action at this time.
0 commit comments