Closed mikeangstadt closed 8 years ago
Can you submit an example?
Sure, the below is an example of an img tag passed as a child of an a tag.
h('a', { href:'/some-page.php'}, [
h('img', {
alt:'Our company logo',
src: 'https://www.our_company_website.com/logo.png'
})
]);
renders this error in 14.1.0 (not 14.0.0)
Expected a VNode / Vthunk / VWidget / string but:
got:
{
"tagName": "IMG",
"properties": {
"alt": "Our company logo",
"src": "https://www.our_company_website.com/logo.png"
},
"children": [],
"namespace": null,
"count": 0,
"hasWidgets": false,
"hasThunks": false,
"descendantHooks": false
}.
The parent vnode is:
{
"tagName": "A",
"properties": {
"href": "/some-page.php"
}
}
and just to double check, is the fact that the img tag is not quoted a typo?
h(img, {
yes, sorry - updated.
I am unable to reproduce. I attempted to verify using the following patch:
diff --git a/examples/todomvc/todo-app.js b/examples/todomvc/todo-app.js
index 8101aea..6d2a369 100644
--- a/examples/todomvc/todo-app.js
+++ b/examples/todomvc/todo-app.js
@@ -182,6 +182,12 @@ function infoFooter() {
h('p', [
'Part of ',
h('a', { href: 'http://todomvc.com' }, 'TodoMVC')
+ ]),
+ h('a', { href:'http://google.com'}, [
+ h('img', {
+ alt:'Our company logo',
+ src: 'https://www.google.com/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png'
+ })
])
]);
}
14.1 updates virtual-dom. Is your project referencing an older version?
Yes, that is it. we're using in other module virtual-dom:1.3.0
Thanks for the help!
On Wed, Feb 3, 2016 at 12:32 PM, Grant Callaghan notifications@github.com wrote:
I am unable to reproduce. I attempted to verify using the following patch:
diff --git a/examples/todomvc/todo-app.js b/examples/todomvc/todo-app.js index 8101aea..6d2a369 100644 --- a/examples/todomvc/todo-app.js +++ b/examples/todomvc/todo-app.js @@ -182,6 +182,12 @@ function infoFooter() { h('p', [ 'Part of ', h('a', { href: 'http://todomvc.com' }, 'TodoMVC')
- ]),
- h('a', { href:'http://google.com'}, [
- h('img', {
- alt:'Our company logo',
- src: 'https://www.google.com/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png'
- }) ]) ]); }
14.1 updates virtual-dom. Is your project referencing an older version?
— Reply to this email directly or view it on GitHub https://github.com/Raynos/mercury/issues/201#issuecomment-179393026.
Mike Angstadt www.mikeangstadt.com @mike_angstadt http://www.twitter.com/mike_angstadt | LinkedIn http://www.linkedin.com/in/mikeangstadt 610-914-4409
"The noblest pleasure is the joy of understanding" - Leonardo Di Vinci
Excellent! do you mind closing the issue then?
Quick note on this issue. It looks like mercury 14.1.0 should have been a major bump to 15.0.0. The vdom upgrade makes mercury 14.0.0 incompatible with 14.1.0.
Any VNode which takes a nested VNode (which was valid in 14.0.0) as an input now breaks in 14.1.0
js fails on: "Expected VNodeTree | VNode | string but got: "
when "got" is valid VNode.