We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e233e5b commit c175289Copy full SHA for c175289
lib/generators/templates/component.es6.jsx
@@ -1,13 +1,12 @@
1
-<%= file_header %>class <%= component_name %> extends React.Component {
2
- render () {
3
- return (
4
- <React.Fragment>
+<%= file_header %>
+function <%= component_name %>(props) {
+ return (
+ <React.Fragment>
5
<% attributes.each do |attribute| -%>
6
- <%= attribute[:name].titleize %>: {this.props.<%= attribute[:name].camelize(:lower) %>}
+ <%= attribute[:name].titleize %>: {props.<%= attribute[:name].camelize(:lower) %>}
7
<% end -%>
8
- </React.Fragment>
9
- );
10
- }
+ </React.Fragment>
+ );
11
}
12
13
<% if attributes.size > 0 -%>
@@ -17,4 +16,5 @@
17
16
18
};
19
+
20
<%= file_footer %>
0 commit comments