Sha256: a5b81f0dadbef478ec80d6c7b0d5f88fec70a1b036fc9dbf20292c9292f1976b
Contents?: true
Size: 932 Bytes
Versions: 13
Compression:
Stored size: 932 Bytes
Contents
<%= file_header %> <% unions = attributes.select{ |a| a[:union] } -%> <% if unions.size > 0 -%> <% unions.each do |e| -%> type <%= e[:name].titleize %> = <%= e[:type]%> <% end -%> <% end -%> interface I<%= component_name %>Props { <% if attributes.size > 0 -%> <% attributes.each do | attribute | -%> <% if attribute[:union] -%> <%= attribute[:name].camelize(:lower) %>: <%= attribute[:name].titleize %>; <% else -%> <%= attribute[:name].camelize(:lower) %>: <%= attribute[:type] %>; <% end -%> <% end -%> <% end -%> } interface I<%= component_name %>State { } class <%= component_name %> extends React.Component <I<%= component_name %>Props, I<%= component_name %>State> { render() { return ( <React.Fragment> <% attributes.each do |attribute| -%> <%= attribute[:name].titleize %>: {this.props.<%= attribute[:name].camelize(:lower) %>} <% end -%> </React.Fragment> ); } } <%= file_footer %>
Version data entries
13 entries across 13 versions & 1 rubygems