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

useOnSelectionChange on change must be memoized now #4273

Closed
jroith opened this issue May 10, 2024 · 1 comment
Closed

useOnSelectionChange on change must be memoized now #4273

jroith opened this issue May 10, 2024 · 1 comment

Comments

@jroith
Copy link

jroith commented May 10, 2024

Describe the Bug

The on change callback must be memoized using useCallback now. Otherwise the event triggers only when deselecting a node.

Your Example Website or App

No response

Steps to Reproduce the Bug or Issue

  1. Pass an onChange function to useOnSelectionChange that has not been wrapped in useCallback.
  2. Observe that the event only triggers when deselecting a node.

Expected behavior

This should be documented as a breaking change or fixed.

Screenshots or Videos

No response

Platform

  • OS: [e.g. macOS, Windows, Linux]
  • Browser: [e.g. Chrome, Safari, Firefox]
  • Version: [e.g. 91.1]

Additional context

No response

@moklick
Copy link
Member

moklick commented Jun 2, 2024

Thanks. Documented!

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

No branches or pull requests

2 participants