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
DOM inside canvas #49
Comments
You'll get mixed results with DOM inside canvas. Usually this is used to provide fallback content for user agents that don't support , or for screen readers. Screen readers on mobile do not support this use case very well though. See issue #5. Surface does not currently support React.DOM.* children. |
Interesting. My use case would be to enhance performance of some pieces but not all of them. Minor pieces of the UI like icons, buttons, titlebars, etc don't need to be copy/pasteable, but would benefit greatly from canvas, while other areas that are text heavy would be great to still use DOM. Will probably take me a while but in the future I'd like to look into this more. Let me know if you have any other readings or tips! |
Certainly - you don't have to use React Canvas for the entire UI. flipboard.com, for instance, uses standard DOM rendering for articles where text selection is more essential. You can use a render: function() {
<div>
<Surface />
<div className='loading' />
</div>
} |
I've searched around a bit and it seems like it's at least possible, I tried out putting an SVG inside a Surface but got an error. Have you guys tried this, or have any thoughts on implementing?
https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API/Drawing_DOM_objects_into_a_canvas
http://www.paciellogroup.com/blog/2015/02/html5-canvas-sub-dom/
The text was updated successfully, but these errors were encountered: