Skip to content

Commit 314a47c

Browse files
committed
docs(linter): Clarify the no-find-dom-node rule with a note that the method was removed in React 19. (#18556)
And so this rule is important to enforce for codebases on 17/18, to make the upgrade easier later.
1 parent 43eccaa commit 314a47c

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

crates/oxc_linter/src/rules/react/no_find_dom_node.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,16 @@ pub struct NoFindDomNode;
2121
declare_oxc_lint!(
2222
/// ### What it does
2323
///
24-
/// This rule disallows the use of `findDOMNode`.
24+
/// This rule disallows the use of `findDOMNode`, which was deprecated in 2018 and removed in React 19.
2525
///
2626
/// ### Why is this bad?
2727
///
2828
/// `findDOMNode` is an escape hatch used to access the underlying DOM node.
2929
/// In most cases, use of this escape hatch is discouraged because it pierces the component abstraction.
30-
/// [It has been deprecated in `StrictMode`.](https://legacy.reactjs.org/docs/strict-mode.html#warning-about-deprecated-finddomnode-usage)
30+
/// It has been deprecated for years, and was
31+
/// [removed from React entirely in React 19](https://react.dev/blog/2024/04/25/react-19-upgrade-guide#removed-reactdom-finddomnode).
32+
///
33+
/// It should not be used.
3134
///
3235
/// ### Examples
3336
///

0 commit comments

Comments
 (0)