Sha256: f5683231d4dc94312de71474535b5ab8cc15bb8548b27c0d0efa86934c3bd947

Contents?: true

Size: 587 Bytes

Versions: 14

Compression:

Stored size: 587 Bytes

Contents

<%= file_header %>class <%= component_name %> extends React.Component {
  render () {
    return (
      <React.Fragment>
<% attributes.each do |attribute| -%>
        <%= attribute[:name].titleize %>: {this.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

14 entries across 14 versions & 1 rubygems

Version Path
react-rails-2.7.1 lib/generators/templates/component.es6.jsx
react-rails-2.7.0 lib/generators/templates/component.es6.jsx
react-rails-2.7.0.rc.2 lib/generators/templates/component.es6.jsx
react-rails-2.7.0.rc.1 lib/generators/templates/component.es6.jsx
react-rails-2.7.0.rc.0 lib/generators/templates/component.es6.jsx
react-rails-2.6.2 lib/generators/templates/component.es6.jsx
react-rails-2.6.1 lib/generators/templates/component.es6.jsx
react-rails-2.6.0 lib/generators/templates/component.es6.jsx
react-rails-2.5.0 lib/generators/templates/component.es6.jsx
react-rails-2.4.7 lib/generators/templates/component.es6.jsx
react-rails-2.4.6 lib/generators/templates/component.es6.jsx
react-rails-2.4.5 lib/generators/templates/component.es6.jsx
react-rails-2.4.4 lib/generators/templates/component.es6.jsx
react-rails-2.4.4.pre lib/generators/templates/component.es6.jsx