fix(hydration): handle camel-case tag name when performing match assertion (#3247)
fix #3243
This commit is contained in:
parent
420c8f4580
commit
9036f88d83
@ -626,6 +626,15 @@ describe('SSR hydration', () => {
|
|||||||
expect(spy).toHaveBeenCalled()
|
expect(spy).toHaveBeenCalled()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
test('elements with camel-case in svg ', () => {
|
||||||
|
const { vnode, container } = mountWithHydration(
|
||||||
|
'<animateTransform></animateTransform>',
|
||||||
|
() => h('animateTransform')
|
||||||
|
)
|
||||||
|
expect(vnode.el).toBe(container.firstChild)
|
||||||
|
expect(`Hydration node mismatch`).not.toHaveBeenWarned()
|
||||||
|
})
|
||||||
|
|
||||||
test('SVG as a mount container', () => {
|
test('SVG as a mount container', () => {
|
||||||
const svgContainer = document.createElement('svg')
|
const svgContainer = document.createElement('svg')
|
||||||
svgContainer.innerHTML = '<g></g>'
|
svgContainer.innerHTML = '<g></g>'
|
||||||
|
@ -158,7 +158,8 @@ export function createHydrationFunctions(
|
|||||||
if (shapeFlag & ShapeFlags.ELEMENT) {
|
if (shapeFlag & ShapeFlags.ELEMENT) {
|
||||||
if (
|
if (
|
||||||
domType !== DOMNodeTypes.ELEMENT ||
|
domType !== DOMNodeTypes.ELEMENT ||
|
||||||
vnode.type !== (node as Element).tagName.toLowerCase()
|
(vnode.type as string).toLowerCase() !==
|
||||||
|
(node as Element).tagName.toLowerCase()
|
||||||
) {
|
) {
|
||||||
nextNode = onMismatch()
|
nextNode = onMismatch()
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user