Skip to content

rails generate component builds an unusable component #261

@DanielMSchmidt

Description

@DanielMSchmidt

Hi there,

First of all thanks for this great lib!

The bug I encountered is neither critical, nor hard to fix:
If you type rails g react:component SubscriptionForm subscribable_type:string subscribable_id:number you get a component which looks like this:

var SubscriptionForm = React.createClass({
  propTypes: {
    subscribableType: React.PropTypes.string,
    subscribableId: React.PropTypes.number
  },

  render: function() {
    return (
      <div>
        <div>Subscribable Type: {this.props.subscribable_type}</div>
        <div>Subscribable: {this.props.subscribable_id}</div>
      </div>
    );
  }
});

So the either the propTypes or the props used in the render function are correct. If I find time later I will maybe add a PR.

Regards!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions