Sha256: 795fa5e97e30334c97924afe828ffa01fb723c5ac45c1dfc161d8474706d414f

Contents?: true

Size: 616 Bytes

Versions: 24

Compression:

Stored size: 616 Bytes

Contents

class <%= file_name.camelize %> 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 -%>

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
react-rails-2.1.0 lib/generators/templates/component.es6.jsx
react-rails-2.0.2 lib/generators/templates/component.es6.jsx
react-rails-2.0.0 lib/generators/templates/component.es6.jsx
react-rails-1.11.0 lib/generators/templates/component.es6.jsx
react-rails-1.10.0 lib/generators/templates/component.es6.jsx
react-rails-1.9.0 lib/generators/templates/component.es6.jsx
react-rails-1.8.2 lib/generators/templates/component.es6.jsx
react-rails-1.8.1 lib/generators/templates/component.es6.jsx
react-rails-1.8.0 lib/generators/templates/component.es6.jsx
react-rails-1.7.2 lib/generators/templates/component.es6.jsx
react-rails-1.7.1 lib/generators/templates/component.es6.jsx
react-rails-1.7.0 lib/generators/templates/component.es6.jsx
react-rails-1.6.2 lib/generators/templates/component.es6.jsx
react-rails-1.6.1 lib/generators/templates/component.es6.jsx
react-rails-1.6.0 lib/generators/templates/component.es6.jsx
react-rails-1.5.0 lib/generators/templates/component.es6.jsx
react-rails-1.4.2 lib/generators/templates/component.es6.jsx
react-rails-1.4.1 lib/generators/templates/component.es6.jsx
react-rails-1.4.0 lib/generators/templates/component.es6.jsx
react-rails-1.3.3 lib/generators/templates/component.es6.jsx