We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 88455b3 commit 508e45fCopy full SHA for 508e45f
src/index.js
@@ -2,8 +2,10 @@ import {getQueriesForElement, prettyDOM} from 'dom-testing-library'
2
3
export * from 'dom-testing-library'
4
const mountedContainers = new Set()
5
-export const render = (Component, {target = document.createElement('div'), ...options} = {}) => {
6
- document.body.appendChild(target)
+export const render = (Component, {target, ...options} = {}) => {
+ if (!target) {
7
+ target = document.body.appendChild(document.createElement('div'))
8
+ }
9
10
const component = new Component({
11
...options,
0 commit comments