Sha256: bb2478551e2c0c1b7ae1593ae4f3459dc6973a8373af2995581e420d0525bda7

Contents?: true

Size: 570 Bytes

Versions: 14

Compression:

Stored size: 570 Bytes

Contents

<%= file_header %>var <%= component_name %> = createReactClass({
<% if attributes.size > 0 -%>
  propTypes: {
<% attributes.each_with_index do |attribute, idx| -%>
    <%= attribute[:name].camelize(:lower) %>: <%= attribute[:type] %><% if (idx < attributes.length-1) %>,<% end %>
<% end -%>
  },
<% end -%>

  render: function() {
    return (
      <React.Fragment>
<% attributes.each do |attribute| -%>
        <%= attribute[:name].titleize %>: {this.props.<%= attribute[:name].camelize(:lower) %>}
<% end -%>
      </React.Fragment>
    );
  }
});
<%= file_footer %>

Version data entries

14 entries across 14 versions & 1 rubygems

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