Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getDefaultProps() for <AngleBracketComponents/> #182

Open
ariesshrimp opened this issue Apr 29, 2019 · 0 comments
Open

getDefaultProps() for <AngleBracketComponents/> #182

ariesshrimp opened this issue Apr 29, 2019 · 0 comments

Comments

@ariesshrimp
Copy link

Are you opening a BUG REPORT or a FEATURE REQUEST / CODE CHANGE?

There is a section for each below. Please complete the appropriate section and remove the other one.

We realize there is a lot of data requested here. We ask only that you do your best to provide as much information as possible so we can better help you.

BUG REPORT

// components/my-button/component.js
export default Component.extend({
  tagName: '',
  propTypes: {
    kind: PropTypes.oneOf(['a', 'b', 'c']),
  },
  getDefaultProps() {
    return {
      kind: 'a'
    };
  }
});
<!-- tempates/components/my-button/template.hbs -->
<button class={{kind}}>{{yield}}</button>
<!-- some template -->
<MyButton>a button with default props</MyButton>

Summary

The above code doesn't apply the expect default for <MyButton/>

Expected Behavior

<MyButton/> should have attrs: {kind:"a"}

Actual Behavior

<MyButton/> has attrs: {}

I dunno, but this library might just be incompatible w/ angle bracket syntax: https://discordapp.com/channels/480462759797063690/483601670685720591/572490471230668812

emberjs/rfcs#479

does that seem right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant