Skip to content

Commit

Permalink
Merge pull request #54 from hypothesis/add-container-to-body
Browse files Browse the repository at this point in the history
Add container element to `document.body`
  • Loading branch information
robertknight authored Nov 26, 2024
2 parents ce30201 + ff6df8a commit 09a6105
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/mount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ export function mount(jsx: VNode, { connected = false }: MountOptions = {}) {
const container = document.createElement('div');
container.setAttribute('data-enzyme-container', '');
containers.push(container);

document.body.append(container);

wrapper = enzyme.mount(jsx, { attachTo: container });
} else {
wrapper = enzyme.mount(jsx);
Expand Down

0 comments on commit 09a6105

Please sign in to comment.