Sha256: 81ff23e8d4a2b30d3503461aa700efec710f5696b4118744e1ef3f12b09ee4cc

Contents?: true

Size: 544 Bytes

Versions: 5

Compression:

Stored size: 544 Bytes

Contents

<%= file_header %>
const <%= component_name %> = (props) => {
  return (
    <React.Fragment>
<% attributes.each do |attribute| -%>
      <%= attribute[:name].titleize %>: {props.<%= attribute[:name].camelize(:lower) %>}
<% end -%>
    </React.Fragment>
  )
}

<% 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

5 entries across 5 versions & 1 rubygems

Version Path
react-rails-3.2.0 lib/generators/templates/component.es6.jsx
react-rails-3.1.1 lib/generators/templates/component.es6.jsx
react-rails-3.1.0 lib/generators/templates/component.es6.jsx
react-rails-3.0.0 lib/generators/templates/component.es6.jsx
react-rails-3.0.0.rc.0 lib/generators/templates/component.es6.jsx