Skip to content

Commit d14e1a7

Browse files
committed
fix(types): support for Vue 2.7
1 parent fc8c28b commit d14e1a7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/pinia/src/types.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,9 @@ export type _StoreWithGetters_Writable<G> = {
474474
? K
475475
: // NOTE: there is still no way to have a different type for a setter and a getter in TS with dynamic keys
476476
// https://github.com/microsoft/TypeScript/issues/43826
477-
never]: G[K] extends WritableComputedRef<infer R, infer _S> ? R : never
477+
// NOTE: to support Vue 2.7, we need to use Readonly and not infer the second type param
478+
// https://github.com/vuejs/pinia/issues/2767#issuecomment-2601284366
479+
never]: G[K] extends Readonly<WritableComputedRef<infer R>> ? R : never
478480
}
479481

480482
/**

0 commit comments

Comments
 (0)