mantine
mantine copied to clipboard
Error on useResizeObserver and Group
Dependencies check up
- [X] I have verified that I use latest version of all @mantine/* packages
What version of @mantine/* packages do you have in package.json?
7.5.3
What package has an issue?
@mantine/core
What framework do you use?
Next.js
In which browsers you can reproduce the issue?
None
Describe the bug
Type 'MutableRefObject<HTMLDivElement | undefined>' is not assignable to type 'Ref<HTMLDivElement> | undefined'. Type 'MutableRefObject<HTMLDivElement | undefined>' is not assignable to type 'RefObject<HTMLDivElement>'. Types of property 'current' are incompatible. Type 'HTMLDivElement | undefined' is not assignable to type 'HTMLDivElement | null'. Type 'undefined' is not assignable to type 'HTMLDivElement | null'.typescript(2322)
If possible, include a link to a codesandbox with a minimal reproduction
https://codesandbox.io/p/sandbox/mantine-group-ref-error-kvx58y
Possible fix
No response
Self-service
- [ ] I would be willing to implement a fix for this issue
Is wrong use only: const [refRightSection, rectRightSection] = useResizeObserver<HTMLDivElement>();
?
I'm having a similar issue, looks to be caused by the fix to https://github.com/mantinedev/mantine/issues/5752
Fixed in 7.6.1
@rtivital I'm a little confused by this fix. Why are we now returning any?
error Unsafe array destructuring of a tuple element with an `any` value @typescript-eslint/no-unsafe-assignment
ui:lint:
error Unsafe member access .current on an `any` value @typescript-eslint/no-unsafe-member-access
Same here: https://github.com/mantinedev/mantine/commit/ec4fcf77d83a63ef050547e82d69bd3a03e1ef34#commitcomment-139346444
Unsafe assignment of an `any` value.eslint[@typescript-eslint/no-unsafe-assignment](https://typescript-eslint.io/rules/no-unsafe-assignment)