infernojs / babel-plugin-inferno

Transforms JSX to InfernoJS vNodes
MIT License
79 stars 26 forks source link

Boolean Attributes and Multi-word Attributes Fail #8

Closed JustinWilabyPrecor closed 8 years ago

JustinWilabyPrecor commented 8 years ago

The following JSX fails:

<button aria-selected="false" disabled>{i18n.t('buttonText')}</button>

aria-selected needs to be quoted in the attrs Object (unexpected token "-") and the boolean attribute disabled yields a null attribute.value.

Looks like this is a Babel defect but I'd like to confirm.

NoiSek commented 8 years ago

I can confirm this is an issue, ran into this last week. I don't think it's a Babel defect. Inferno compiles to {key: value} format rather than {"key": value} format in its templates which causes this.

justinwilaby commented 8 years ago

Addressed in #9

trueadm commented 8 years ago

@justinwilaby I do believe JSX doesn't support using hyphen in prop names, although I may be wrong here. I'll look into it a bit further.