Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
sunnylqm committed May 14, 2024
1 parent 7e94269 commit 71bef45
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions site/pages/docs/api.md → site/pages/docs/api.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ title: API参考
type: 开发指南
---

import { Callout } from "nextra/components";

### JavaScript 方法

#### new Pushy(options: PushyOptions)
Expand Down Expand Up @@ -98,6 +100,10 @@ interface EventData {

热更相关的工具函数。

<Callout type="info">
注意,在使用 `<PushyProvider>` 的当前组件(一般是根组件)中无法直接调用`usePushy`,只有当前组件的子组件才能调用。
</Callout>

```js
const {
checkUpdate,
Expand Down
2 changes: 2 additions & 0 deletions site/pages/docs/integration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ const pushyClient = new Pushy({

// 在根组件外加上PushyProvider后导出
export default function Root() {
// 注意,在使用 PushyProvider 的当前组件中,无法直接调用 usePushy
// 只有当前组件的子组件才能调用 usePushy
return (
<PushyProvider client={pushyClient}>
{/* ↓ 整个应用的根组件放到PushyProvider中 */}
Expand Down

0 comments on commit 71bef45

Please sign in to comment.