Sha256: b99a33670d247aa92ebe21ceab1e12f84d9288700a0d08987266355ccda772f2
Contents?: true
Size: 649 Bytes
Versions: 8
Compression:
Stored size: 649 Bytes
Contents
<%= file_header %>class <%= component_name %> extends React.Component { render () { <% if attributes.size > 0 -%> return ( <div> <% attributes.each do |attribute| -%> <div><%= attribute[:name].titleize %>: {this.props.<%= attribute[:name].camelize(:lower) %>}</div> <% end -%> </div> ); <% else -%> return <div />; <% end -%> } } <% if attributes.size > 0 -%> <%= file_name.camelize %>.propTypes = { <% attributes.each_with_index do |attribute, idx| -%> <%= attribute[:name].camelize(:lower) %>: <%= attribute[:type] %><% if (idx < attributes.length-1) %>,<% end %> <% end -%> }; <% end -%> <%= file_footer %>
Version data entries
8 entries across 8 versions & 1 rubygems