mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 21:05:19 +00:00
feat(component): helper function observeResize to observe size change via global ResizeObserver (#7241)
```ts
import { observeResize } from "@affine/component";
useEffect(() => {
const dispose = observeResize(element entry => {
console.log(entry.contentRect);
});
return () => dispose();
}, []);
```
This commit is contained in:
1
packages/frontend/component/src/utils/index.ts
Normal file
1
packages/frontend/component/src/utils/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
export * from './observe-resize';
|
||||
Reference in New Issue
Block a user