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

[@mantine/hooks] useResizeObserver: convert to mutable ref and fix useEffect #4632

Merged

Conversation

KurtGokhan
Copy link
Contributor

Reverts most of the changes in #4512 because it introduced a breaking change to the useResizeObserver hook. Instead of using callback ref, the hook will keep using mutable ref. But I replaced useEffect with useIsomorphicEffect so that the size is calculated as soon as element is mounted.

@rtivital rtivital merged commit 790388a into mantinedev:master Aug 10, 2023
1 check passed
@rtivital
Copy link
Member

Thanks!

puehringer added a commit to datavisyn/visyn_core that referenced this pull request Aug 12, 2023
Now that @mantine/core contains the
[fix](https://github.com/mantinedev/mantine/releases/tag/6.0.19) for
incorrect [useResizeObserver
typings](mantinedev/mantine#4632), we can safely
upgrade again.
arel pushed a commit to arel/mantine that referenced this pull request Sep 13, 2023
…izeObserver` in the previous patch (mantinedev#4632)

* revert changes to the hook

* use useIsomorphicEffect hook instead of useEffect

* initialize rect with getBoundingClientRect

* fix prettier issue
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.

None yet

2 participants