diff --git a/.changeset/config.json b/.changeset/config.json index 817e979b40..7fc1112ce4 100644 --- a/.changeset/config.json +++ b/.changeset/config.json @@ -6,5 +6,5 @@ "access": "public", "baseBranch": "master", "updateInternalDependencies": "patch", - "ignore": [] + "ignore": ["@react-spring/demo", "@react-spring/docs"] } diff --git a/.changeset/cuddly-dolls-sit.md b/.changeset/cuddly-dolls-sit.md new file mode 100644 index 0000000000..74d180e760 --- /dev/null +++ b/.changeset/cuddly-dolls-sit.md @@ -0,0 +1,16 @@ +--- +'@react-spring/core': patch +'@react-spring/animated': patch +'@react-spring/parallax': patch +'@react-spring/rafz': patch +'react-spring': patch +'@react-spring/shared': patch +'@react-spring/types': patch +'@react-spring/konva': patch +'@react-spring/native': patch +'@react-spring/three': patch +'@react-spring/web': patch +'@react-spring/zdog': patch +--- + +fix: allow transpile from TS < 4.7 diff --git a/.changeset/pre.json b/.changeset/pre.json new file mode 100644 index 0000000000..6272d3445a --- /dev/null +++ b/.changeset/pre.json @@ -0,0 +1,21 @@ +{ + "mode": "pre", + "tag": "beta", + "initialVersions": { + "@react-spring/demo": "0.0.1", + "@react-spring/docs": "1.0.7", + "@react-spring/animated": "9.5.4", + "@react-spring/core": "9.5.4", + "@react-spring/parallax": "9.5.4", + "@react-spring/rafz": "9.5.4", + "react-spring": "9.5.4", + "@react-spring/shared": "9.5.4", + "@react-spring/types": "9.5.4", + "@react-spring/konva": "9.5.4", + "@react-spring/native": "9.5.4", + "@react-spring/three": "9.5.4", + "@react-spring/web": "9.5.4", + "@react-spring/zdog": "9.5.4" + }, + "changesets": [] +} diff --git a/packages/core/src/hooks/useSpring.ts b/packages/core/src/hooks/useSpring.ts index 44cc5a8ff7..bbfaf5f2be 100644 --- a/packages/core/src/hooks/useSpring.ts +++ b/packages/core/src/hooks/useSpring.ts @@ -10,17 +10,19 @@ import { useSprings } from './useSprings' * The props that `useSpring` recognizes. */ export type UseSpringProps = unknown & - PickAnimated extends infer State extends Lookup - ? Remap< - ControllerUpdate & { - /** - * Used to access the imperative API. - * - * When defined, the render animation won't auto-start. - */ - ref?: SpringRef - } - > + PickAnimated extends infer State + ? State extends Lookup + ? Remap< + ControllerUpdate & { + /** + * Used to access the imperative API. + * + * When defined, the render animation won't auto-start. + */ + ref?: SpringRef + } + > + : never : never /** @@ -32,8 +34,10 @@ export function useSpring( | Function | (() => (Props & Valid>) | UseSpringProps), deps?: readonly any[] | undefined -): PickAnimated extends infer State extends Lookup - ? [SpringValues, SpringRef] +): PickAnimated extends infer State + ? State extends Lookup + ? [SpringValues, SpringRef] + : never : never /** @@ -49,8 +53,10 @@ export function useSpring( export function useSpring( props: (Props & Valid>) | UseSpringProps, deps: readonly any[] | undefined -): PickAnimated extends infer State extends Lookup - ? [SpringValues, SpringRef] +): PickAnimated extends infer State + ? State extends Lookup + ? [SpringValues, SpringRef] + : never : never /** @internal */ diff --git a/packages/core/src/hooks/useSprings.ts b/packages/core/src/hooks/useSprings.ts index bca5c8f2b4..08e603a07a 100644 --- a/packages/core/src/hooks/useSprings.ts +++ b/packages/core/src/hooks/useSprings.ts @@ -43,8 +43,10 @@ export function useSprings( length: number, props: (i: number, ctrl: Controller) => Props, deps?: readonly any[] -): PickAnimated extends infer State extends Lookup - ? [SpringValues[], SpringRefType] +): PickAnimated extends infer State + ? State extends Lookup + ? [SpringValues[], SpringRefType] + : never : never /** @@ -62,8 +64,10 @@ export function useSprings( length: number, props: Props[] & UseSpringsProps>[], deps: readonly any[] | undefined -): PickAnimated extends infer State extends Lookup - ? [SpringValues[], SpringRefType] +): PickAnimated extends infer State + ? State extends Lookup + ? [SpringValues[], SpringRefType] + : never : never /** @internal */ diff --git a/packages/core/src/hooks/useTrail.ts b/packages/core/src/hooks/useTrail.ts index 1d30f9e269..399308c92f 100644 --- a/packages/core/src/hooks/useTrail.ts +++ b/packages/core/src/hooks/useTrail.ts @@ -19,8 +19,10 @@ export function useTrail( ctrl: Controller ) => UseTrailProps | (Props & Valid>), deps?: readonly any[] -): PickAnimated extends infer State extends Lookup - ? [SpringValues[], SpringRef] +): PickAnimated extends infer State + ? State extends Lookup + ? [SpringValues[], SpringRef] + : never : never export function useTrail( @@ -32,8 +34,10 @@ export function useTrail( length: number, props: UseTrailProps | (Props & Valid>), deps: readonly any[] -): PickAnimated extends infer State extends Lookup - ? [SpringValues[], SpringRef] +): PickAnimated extends infer State + ? State extends Lookup + ? [SpringValues[], SpringRef] + : never : never export function useTrail( diff --git a/packages/core/src/hooks/useTransition.tsx b/packages/core/src/hooks/useTransition.tsx index 4f9a488cfc..52492579ad 100644 --- a/packages/core/src/hooks/useTransition.tsx +++ b/packages/core/src/hooks/useTransition.tsx @@ -45,8 +45,10 @@ export function useTransition( | UseTransitionProps | (Props & Valid>), deps?: any[] -): PickAnimated extends infer State extends Lookup - ? [TransitionFn>, SpringRefType] +): PickAnimated extends infer State + ? State extends Lookup + ? [TransitionFn>, SpringRefType] + : never : never export function useTransition( @@ -62,8 +64,10 @@ export function useTransition( | UseTransitionProps | (Props & Valid>), deps: any[] | undefined -): PickAnimated extends infer State extends Lookup - ? [TransitionFn, SpringRefType] +): PickAnimated extends infer State + ? State extends Lookup + ? [TransitionFn, SpringRefType] + : never : never export function useTransition(