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

React throws when rendering some HTML tags inside Windows 8 app. #441

Closed
joshduck opened this issue Oct 22, 2013 · 6 comments
Closed

React throws when rendering some HTML tags inside Windows 8 app. #441

joshduck opened this issue Oct 22, 2013 · 6 comments

Comments

@joshduck
Copy link
Contributor

When using React in a JavaScript-based Windows 8 app, some HTML tags will cause an error to be thrown during mounting. For example an audio tag, as shown here causes the following error.

0x800c001c - JavaScript runtime error: Unable to add dynamic content. A script attempted to inject dynamic content, or elements previously modified dynamically, that might be unsafe. For example, using the innerHTML property to add script or malformed HTML will generate this exception. Use the toStaticHTML method to filter dynamic content, or explicitly create elements and attributes with a method such as createElement. For more information, see http://go.microsoft.com/fwlink/?LinkID=247104.

This is not a hugely pressing issue, but we should probably offer some way of using window.toStaticHTML where it's available.

@sophiebits
Copy link
Collaborator

Shouldn't we just use createElement for those elements instead?

@sophiebits
Copy link
Collaborator

Alternatively, I suppose setInnerHTMLUnsafe would do the trick too in this case…

http://msdn.microsoft.com/en-us/library/windows/apps/br211696.aspx

@syranide
Copy link
Contributor

Is this something we still want to solve? It seems the fix would be simple enough.

@stkb
Copy link
Contributor

stkb commented Nov 9, 2014

I just came across this bug, by using name attributes on input tags. I worked around it, but it would be nice if there was a fix

@Porshe
Copy link

Porshe commented Dec 9, 2014

When do you plan to fix this?

@stkb
Copy link
Contributor

stkb commented Jan 2, 2015

I thought I'd go ahead and create a pull request (#2799) to fix this. It works by wrapping the innerHTML-setting code in execUnsafeLocalFunction().

This issue was closed.
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

6 participants