Skip to content

Commit 6682068

Browse files
authored
Tweak event delegation notes
1 parent 16a03c0 commit 6682068

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

content/docs/testing-recipes.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,6 @@ let container = null;
377377
beforeEach(() => {
378378
// setup a DOM element as a render target
379379
container = document.createElement("div");
380-
// container *must* be attached to document so events work correctly.
381380
document.body.appendChild(container);
382381
});
383382
@@ -416,7 +415,7 @@ it("changes value when clicked", () => {
416415
});
417416
```
418417

419-
Different DOM events and their properties are described in [MDN](https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent). Note that you need to pass `{ bubbles: true }` in each event you create for it to reach the React listener because React automatically delegates events to the document.
418+
Different DOM events and their properties are described in [MDN](https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent). Note that you need to pass `{ bubbles: true }` in each event you create for it to reach the React listener because React automatically delegates events to the root.
420419

421420
> Note:
422421
>

0 commit comments

Comments
 (0)