-
Notifications
You must be signed in to change notification settings - Fork 2
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
Deprecate useDisposable #676
Conversation
ui/components-react/src/components-react/tree/controlled/TreeHooks.ts
Outdated
Show resolved
Hide resolved
ui/components-react/src/components-react/tree/controlled/TreeHooks.ts
Outdated
Show resolved
Hide resolved
Co-authored-by: Grigas <[email protected]>
Co-authored-by: Raphaël LEMIEUX <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a note in NextVersion.md
@raplemie Added note to NextVersion.md |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd appreciate it if you'd add a PR number to changes in NextVersion.md
while resolving the merge conflicts (i.e. #700)
Changes
Deprecated
useDisposable
hook. It is not compatible with React 18 StrictMode and there is no way to make it work correctly without changing API. UpdateduseOptionalDisposable
to work correctly. Made some changes touseDisposable
hook to make it work in React 18 StrictMode as best as it can. Current implementation will leak some disposable resources in StrictMode but should work correctly when StrictMode is disabled.Deprecated
useTreeEventsHandler
because it was based onuseDisposable
hook. Added newuseControlledTreeEventsHandler
hooks to replace it.Testing
Ran modified tests in Presentation repo that uses
useDisposable
hook https://github.com/iTwin/presentation/blob/master/packages/components/src/test/hooks/UseRulesetRegistration.test.ts