Skip to content

Commit c175289

Browse files
committed
Change es6 template to a function component
1 parent e233e5b commit c175289

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
1-
<%= file_header %>class <%= component_name %> extends React.Component {
2-
render () {
3-
return (
4-
<React.Fragment>
1+
<%= file_header %>
2+
function <%= component_name %>(props) {
3+
return (
4+
<React.Fragment>
55
<% attributes.each do |attribute| -%>
6-
<%= attribute[:name].titleize %>: {this.props.<%= attribute[:name].camelize(:lower) %>}
6+
<%= attribute[:name].titleize %>: {props.<%= attribute[:name].camelize(:lower) %>}
77
<% end -%>
8-
</React.Fragment>
9-
);
10-
}
8+
</React.Fragment>
9+
);
1110
}
1211

1312
<% if attributes.size > 0 -%>
@@ -17,4 +16,5 @@
1716
<% end -%>
1817
};
1918
<% end -%>
19+
2020
<%= file_footer %>

0 commit comments

Comments
 (0)