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

Can't use attribute without value in jsx #33

Open
mcheshkov opened this issue Apr 22, 2016 · 5 comments
Open

Can't use attribute without value in jsx #33

mcheshkov opened this issue Apr 22, 2016 · 5 comments

Comments

@mcheshkov
Copy link

jsx('<button disabled>foo</button>');

This gives me Invalid JSX: Expected =, when react itself can handle jsx like that. Easy to work around, but confusing at first.

@elsassph
Copy link
Contributor

Aw right, we're using Haxe's built in XML parser. Needs some patching.

@elsassph elsassph added the bug label Apr 23, 2016
@elsassph
Copy link
Contributor

As far as I can tell this is a limitation of Haxe's (macro time) XML parser. It can't be resolved without using an alternative XML parser. So no short term fix for that.

@kevinresol
Copy link
Contributor

I think a patch in haxe's xml parser will do. https://github.com/HaxeFoundation/haxe/blob/development/std/haxe/xml/Parser.hx

@elsassph
Copy link
Contributor

Mmmh right if the parser is implemented in Haxe already then it might be simple to fix. We thought about having a single parser for JSX instead of making JSX valid XML.

@Jarrio
Copy link

Jarrio commented May 5, 2017

If anybody ever comes to this situation the syntax above is incorrect. To use those types of attributes you want to specify the boolean value eg - jsx('<button disabled={true}>foo</button>');

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

No branches or pull requests

4 participants