9 |
--------------------------------------------------------------------------------
/docs/demo/collection.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Collection
3 | nav:
4 | title: Demo
5 | path: /demo
6 | ---
7 |
8 | Use `ResizeObserver.Collection` to collect multiple `ResizeObserver` resize event within frame.
9 |
10 |
11 |
--------------------------------------------------------------------------------
/docs/demo/debug.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: debug
3 | nav:
4 | title: Demo
5 | path: /demo
6 | ---
7 |
8 |
9 |
--------------------------------------------------------------------------------
/docs/demo/renderProps.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: renderProps
3 | nav:
4 | title: Demo
5 | path: /demo
6 | ---
7 |
8 |
9 |
--------------------------------------------------------------------------------
/docs/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | hero:
3 | title: rc-resize-observer
4 | description: React Resize-Observer Component
5 | ---
6 |
7 |
8 |
--------------------------------------------------------------------------------
/examples/basic.tsx:
--------------------------------------------------------------------------------
1 | import '../assets/index.less';
2 | import React from 'react';
3 | import type { ResizeObserverProps } from '../src';
4 | import ResizeObserver from '../src';
5 |
6 | const Wrapper = ({ children }: any) => <>{children}>;
7 |
8 | export default function App() {
9 | const [times, setTimes] = React.useState(0);
10 | const [disabled, setDisabled] = React.useState(false);
11 | const textareaRef = React.useRef
24 | `,
25 | 'utf8',
26 | function(error) {
27 | if(error){
28 | console.log(error);
29 | return false;
30 | }
31 | console.log(`${name} 更新成功~`);
32 | }
33 | )
34 | });
35 |
--------------------------------------------------------------------------------