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

docs: update docs #2174

Merged
merged 5 commits into from
May 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions packages/hooks/src/useMutationObserver/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ const useMutationObserver = (
const observer = new MutationObserver(callbackRef.current);
observer.observe(element, options);
return () => {
if (observer) {
observer.disconnect();
}
observer?.disconnect();
};
},
[options],
Expand Down
8 changes: 4 additions & 4 deletions packages/hooks/src/useScroll/index.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ const position = useScroll(target, shouldUpdate);

### Params

| Property | Description | Type | Default |
| ------------ | ------------------------- | --------------------------------------------------------------------------- | ---------- |
| target | DOM element or ref object | `Element` \| `Document` \| `(() => Element)` \| `MutableRefObject<Element>` | `document` |
| shouldUpdate | Whether update position | `({ top: number, left: number }) => boolean` | `-` |
| Property | Description | Type | Default |
| ------------ | ------------------------- | --------------------------------------------------------------------------- | ------------ |
| target | DOM element or ref object | `Element` \| `Document` \| `(() => Element)` \| `MutableRefObject<Element>` | `document` |
| shouldUpdate | Whether update position | `({ top: number, left: number }) => boolean` | `() => true` |

### Result

Expand Down
8 changes: 4 additions & 4 deletions packages/hooks/src/useScroll/index.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ const position = useScroll(target, shouldUpdate);

### Params

| 参数 | 说明 | 类型 | 默认值 |
| ------------ | -------------------- | --------------------------------------------------------------------------- | ---------- |
| target | DOM 节点或者 ref | `Element` \| `Document` \| `(() => Element)` \| `MutableRefObject<Element>` | `document` |
| shouldUpdate | 控制是否更新滚动信息 | `({ top: number, left: number }) => boolean` | - |
| 参数 | 说明 | 类型 | 默认值 |
| ------------ | -------------------- | --------------------------------------------------------------------------- | ------------ |
| target | DOM 节点或者 ref | `Element` \| `Document` \| `(() => Element)` \| `MutableRefObject<Element>` | `document` |
| shouldUpdate | 控制是否更新滚动信息 | `({ top: number, left: number }) => boolean` | `() => true` |

### Result

Expand Down