Skip to content

Commit c245487

Browse files
committed
docs: fix usePrevious reference
1 parent 8567a04 commit c245487

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

docs/usePrevious.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const Demo = createComponent({
3636
## Reference
3737

3838
```typescript
39-
function usePrevious<T>(state: T | Wrapper<T>): Wrapper<T | undefined>;
39+
function usePrevious<T>(state: Wrapper<T> | (() => T)): Wrapper<T>;
4040
```
4141

4242
### `Arguments`
@@ -45,11 +45,10 @@ function usePrevious<T>(state: T | Wrapper<T>): Wrapper<T | undefined>;
4545

4646
`props` or `Wrapper<any>`
4747

48-
- Type: [`T | Wrapper<T>`](https://github.com/vuejs/vue-function-api/blob/1d532fe684e2343973ae46fc3ef93e497e6514b1/src/wrappers/index.ts#L5-L7)
49-
- Default: `undefined`
48+
- Type: [`Wrapper<T> | (() => T)`](https://github.com/vuejs/vue-function-api/blob/1d532fe684e2343973ae46fc3ef93e497e6514b1/src/wrappers/index.ts#L5-L7)
5049

5150
### `ReturnValue`
5251

53-
- [`Wrapper<T | undefined>`](https://github.com/vuejs/vue-function-api/blob/1d532fe684e2343973ae46fc3ef93e497e6514b1/src/wrappers/index.ts#L5-L7)
52+
- [`Wrapper<T>`](https://github.com/vuejs/vue-function-api/blob/1d532fe684e2343973ae46fc3ef93e497e6514b1/src/wrappers/index.ts#L5-L7)
5453

5554
_[`T`](https://www.typescriptlang.org/docs/handbook/generics.html) depends on your `arguments` type_

0 commit comments

Comments
 (0)