Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove findDOMNode usage in Table component #1856

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

henryqdineen
Copy link
Contributor

@henryqdineen henryqdineen commented Nov 14, 2024

The React findDOMNode() API has been deprecated since 2018 and will be removed in React 19, the next major version. This PR removes findDOMNode usage from the Table component for compatibility with Strict Mode and to move towards React 19 compatibility. The WindowScroller and CellMeasurer components also use findDOMNode() but have existing workaround by using the registerChild from the render callback.

My solution in this PR was to add a getDOMNode method on the Grid class and call that from Table. An alternative I considered is to add a new ref domNodeRef to Table and use that to get the reference.

Before submitting a pull request, please complete the following checklist:

  • The existing test suites (npm test) all pass
  • For any new features or bug fixes, both positive and negative test cases have been added
  • For any new features, documentation has been added
  • For any documentation changes, the text has been proofread and is clear to both experienced users and beginners.
  • Format your code with prettier (yarn run prettier).
  • Run the Flow typechecks (yarn run typecheck).

@henryqdineen
Copy link
Contributor Author

henryqdineen commented Nov 14, 2024

I totally missed that this overlapped with #1855. Please close if this PR is unwanted. This is based on a patch-package we did on our version. We are also interested in fixing any defaultProps related deprecation issues but this PR strictly focuses on findDOMNode().

@henryqdineen henryqdineen changed the title remove findDOMNode usage Table component remove findDOMNode usage in Table component Nov 15, 2024
@henryqdineen
Copy link
Contributor Author

Now that React 19 is out I think #1855 should be preferred since it fixes the defaultProps gotchas.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant