-
Notifications
You must be signed in to change notification settings - Fork 1
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
implement dangerouslySetInnerHTML
#1
Comments
Hmmm...I think actually just setting So you'd just do: const req = `<use xlink:href='${glyph}'></use>`
<svg
width={width}
height={height ? height : width}
innerHTML={req}
>
</svg> The core doesn't have any special knowledge of this raw dom that's been inserted. I can't think of anything in particular that would go wrong as a result of that, but it's just not a case i've thought hard about yet or tested much. Want to try it out and let me know? EDIT: That is annoying though that it blows up the jsx compiler. I had just gotten a PR on virtex-dom to properly support those attributes. I wonder if babel has any plans to support that in the future. |
Nice!
Ah right, I'm not sure if this has an impact, but atm I'm just returning const shouldUpdate = () => false
const render = (...)
export {
shouldUpdate,
render
}
React <0.14 implemented |
Hey @ashaffer!
I implemented React's dangerouslySetInnerHTML function for svg contents since these awkward namespaces (
xlink:href
) explode the JSX compiler:Right now the implementation is based on dom and cannot be used for say
virtex-string
.Can you give me some directions of where to implement something like this, but not based on raw dom operations? Is this something that needs to be implemented in core? I'm happy to open a PR.
The text was updated successfully, but these errors were encountered: