Skip to content

Conversation

@ajivanyandev
Copy link
Contributor

No description provided.

@ajivanyandev ajivanyandev self-assigned this Nov 27, 2025
Copilot AI review requested due to automatic review settings November 27, 2025 13:28
@ajivanyandev ajivanyandev changed the title Cherry pick: React - useImperativeHandle dependencies fix and useCallbacks' cleanup (T1308983) React - useImperativeHandle dependencies fix and useCallbacks' cleanup (T1308983) Nov 27, 2025
Copilot finished reviewing on behalf of ajivanyandev November 27, 2025 13:30
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes critical React hooks usage issues in the DevExtreme React wrapper core components by correcting useCallback and useImperativeHandle dependency arrays. The changes prevent unnecessary re-renders and stale closure bugs by implementing the proper pattern of using refs to track the latest function versions while keeping imperative handles stable.

  • Removes incorrect mutable ref values from useCallback and useImperativeHandle dependency arrays
  • Implements the ref-tracking pattern to ensure imperative handles always call the latest function versions without recreating
  • Adds test coverage to verify component refs remain accessible during controlled state updates

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/devextreme-react/src/core/extension-component.tsx Fixed useCallback and useImperativeHandle dependencies; added ref-tracking pattern for createWidget
packages/devextreme-react/src/core/component.tsx Fixed useCallback and useImperativeHandle dependencies; added ref-tracking pattern for createWidget and clearExtensions; modernized optional chaining syntax
packages/devextreme-react/src/core/component-base.tsx Fixed multiple useCallback and useImperativeHandle dependencies; added ref-tracking patterns for createWidget and restoreParentLink
packages/devextreme-react/src/core/tests/test-component.tsx Updated test component to follow the same ref-tracking pattern; added missing semicolon
packages/devextreme-react/src/core/tests/props-updating.test.tsx Added test case to verify component refs remain defined during controlled selection updates; imported fireEvent

Copilot AI review requested due to automatic review settings November 28, 2025 06:23
Copilot finished reviewing on behalf of ajivanyandev November 28, 2025 06:24
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copilot AI review requested due to automatic review settings November 28, 2025 15:09
Copilot finished reviewing on behalf of ajivanyandev November 28, 2025 15:14
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Copilot AI review requested due to automatic review settings December 1, 2025 06:11
Copilot finished reviewing on behalf of ajivanyandev December 1, 2025 06:14
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.

@ajivanyandev ajivanyandev merged commit 62fb2a9 into 25_2 Dec 1, 2025
159 of 162 checks passed
@ajivanyandev ajivanyandev deleted the cherry-pick-25-2/fix/react-ref-option-changed branch December 1, 2025 10:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants