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

Problem with JSX and ECMAScript3 (IE8) #987

Closed
Bonuspunkt opened this issue Jan 29, 2014 · 3 comments
Closed

Problem with JSX and ECMAScript3 (IE8) #987

Bonuspunkt opened this issue Jan 29, 2014 · 3 comments

Comments

@Bonuspunkt
Copy link

I ran into a small problem with the output of the jsx compiler on IE8.
Because IE8 uses ECMAScript3 the reserved words become a problem in the json objects.

Example:

<label for="start">Start</label>
<input id="start" type="date" />

which becomes

React.DOM.label( {for:"start"}, "Start"),
React.DOM.input( {id:"start", type:"date" } ),

to fix this problem, you have to put quotes around the keyword

React.DOM.label( {"for":"start"}, "Start"),
React.DOM.input( {id:"start", type:"date" } ),
@Bonuspunkt
Copy link
Author

use htmlFor instead source

<label htmlFor="start">Start</label>
<input id="start" type="date" />

@zpao
Copy link
Member

zpao commented Jan 29, 2014

We should still allow for (since you can have non-dom components, same with class, etc), but I'm not completely sure if we should be stringifying those keys or if we should add a mode. cc @jeffmo

@jeffmo
Copy link
Contributor

jeffmo commented Jan 29, 2014

Ideally this wouldn't have anything to do with jsx since jsx only promises es5 (off the top of my head I'm not sure if there are other things that would need to change to make it es3 compat) -- but it does seem reasonable that we have a transform that shims this particular es3-ism for ie8 since that's an issue that seems to pop up often

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

3 participants