Skip to content

Error when using <body> tag #636

@rorticus

Description

@rorticus

Bug

There is an error in vdom sometimes when using the <body> tag.

Package Version: 7.0.0-alpha.6

Code

The following unit test reproduces the issue,

it('can attach body and have widgets inserted nodes that are positioned after the body', () => {
	const factory = create({ icache });
	const Button = factory(function Button({ children }) {
		return <div><button>{children()}</button></div>
	});
	const Body = factory(function Button({ children }) {
		return <body><div>{children()}</div></body>
	});
	const App = factory(function App({ middleware }) {
		const open = middleware.icache.getOrSet('open', false);
		debugger;
		return (
			<div>
				<div>first</div>
				{ open && <Button>Close</Button>}
				{ open && <Body>Body</Body> }
				<div><button onclick={() => {
					middleware.icache.set('open', !middleware.icache.getOrSet('open', false));
				}}>Click Me</button></div>
			</div>
		);
	});
	const r = renderer(() => w(App, {}));
	r.mount({ domNode: root });
	(root as any).children[0].children[1].children[0].click();
	resolvers.resolve();
});

Expected behavior:

I can use <body> to my hearts abandon ❤️

Actual behavior:

I get a vdom error 😢

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions