Add SVG support to snabbdom
See original GitHub issueContinuing discussion from tsers-js/snabbdom#2
Nice observations here from @laszlokorte:
I just tried to create my first TSERS component using SVG.
https://gist.github.com/laszlokorte/2a9ae0accca2805bde3eb28c376fd660#file-tsers-component-js-L11-L13
The
width
andheight
attributes of the svg tag itself get set but thecx
,cy
andr
attributes of the circle tag are not set.I think the reason is this check: https://github.com/tsers-js/snabbdom/blob/master/src/index.js#L104-L107 which tries to unify snabbdoms
props
andattrs
options.
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Add svg support · Issue #4 · snabbdom/snabbdom - GitHub
DOM element creation is handled by the core. And there is currently no way the core can create namespaced elements (easily fixable). I've...
Read more >snabbdom - npm
A virtual DOM library with focus on simplicity, modularity, powerful features and performance.. Latest version: 3.5.1, last published: 6 ...
Read more ><text> - SVG: Scalable Vector Graphics - MDN Web Docs
The SVG element draws a graphics element consisting of text. It's possible to apply a gradient, pattern, clipping path, mask, ...
Read more >JSX Cheatsheet - ServiceNow Community
Each property represents a class you want to add to the element and it will be added ... Fragment element to the rescue...
Read more >snabbdom/snabbdom - Gitter
@paldepind Awesome thanks. BTW does Snabbdom support embedding a tree in an element, for example document.body even if this element's contents can ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
It works OK with ReactDOM driver. Thank you for TSERS!
I like the idea of setting namespace recursively to the children of
svg
node. Currently TSERS DOM implementation don’t support embedded observables in vnodes but even with that, I think there is still a way to add namespace afterwards.