Skip to content

Commit 678b939

Browse files
author
Kent C. Dodds
authored
docs: add warning to container docs
1 parent dfab298 commit 678b939

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,11 @@ The containing DOM node of your rendered React Element (rendered using
429429
> `container.firstChild` will only get the first child of that Fragment, not the
430430
> Fragment itself.
431431

432+
> 🚨 If you find yourself using `container` to query for rendered elements then
433+
> you should reconsider! The other queries are designed to be more resiliant to
434+
> changes that will be made to the component you're testing. Avoid using
435+
> `container` to query for elements!
436+
432437
#### `baseElement`
433438

434439
The containing DOM node where your React Element is rendered in the container.

0 commit comments

Comments
 (0)