-
Notifications
You must be signed in to change notification settings - Fork 816
Description
Stencil version:
@stencil/[email protected]
I'm submitting a:
[x] bug report
[ ] feature request
[ ] support request => Please do not submit support requests here, use one of these channels: https://stencil-worldwide.herokuapp.com/ or https://forum.ionicframework.com/
Current behavior:
If you're supposed to use camelCase on attributes in JSX, why does dash-format work almost all of the time? We built an entire demo site for our components using other components. The demoed components are output in their render methods via JSX. But we've been using dash-format for those attributes all along and it worked fine (actually copied from some static HTML demo pages way back). But there's one case where things do not work:
- If you define a camelCase Boolean prop and default it to true,
- Then try to set it to false via the attribute on the custom element using dash-format, it doesn’t update.
- If you use camelCase in the attribute, however (per updated docs CamelCase @Prop() declaration don't work site#114), it does update properly.
If you just use a one-word prop/attribute or no camelCase in the prop, everything works as expected as far as the prop assignment goes.
Expected behavior:
If you're going to still support dash-format for attributes in JSX, then this should still work, as every other case seems to. This would be nice so we don't have to demo two different scenarios for usage in our component docs.
Steps to reproduce:
// insert any relevant code here
@Prop() showHeader: boolean = true;
...
<my-component show-header={false}> - does not work in JSX (yet dash case works in every other scenario across dozens of components and their props)