Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Clarify the drill through
  • Loading branch information
sebmarkbage committed Dec 10, 2018
commit ce516e59bcb0b2c3cde25a404f0455d57ee56a46
4 changes: 3 additions & 1 deletion text/0000-fragment-refs.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,16 @@ function Foo({children}) {
} else {
// mounted, reordered, or removed nodes
for (let node of childNodes) {
// ...
// node is a DOMNode
}
}
}
return <Fragment ref={handleRef}>{children}</Fragment>;
}
```

The child nodes are always DOMNodes because it drills through any custom component and finds the DOM nodes. It never includes classes instances or anything using forwardRef.

This avoids a number of issues with the `findDOMNode` design:

- It would have a callback that fires when any of them changes so you would have a way to detect when the child components changes. E.g. when they swap or get added/removed/reordered.
Expand Down