Skip to content

[BUG] Interface 'MotionStyle' cannot simultaneously extend types #3422

@srijonashraf

Description

@srijonashraf

Describe the bug

TypeScript error:

Interface 'MotionStyle' cannot simultaneously extend types 
'MakeMotionHelper<Omit<CSSProperties, "perspective" | "rotate" | "scale">>' 
and 'MakeMotionHelper<TransformProperties>'.
Named property 'x' of these types is not identical.

This occurs when using motion with React 19 and skipLibCheck: false.

Reproduction (CodeSandbox or minimal project)

package.json

{
  "dependencies": {
    "react": "^19.2.1",
    "react-dom": "^19.2.1",
    "motion": "^12.23.25",
    "next": "^15.5.7"
  },
  "devDependencies": {
    "@types/react": "^19",
    "@types/react-dom": "^19",
    "typescript": "^5"
  }
}

Component

import { motion, AnimatePresence } from "motion/react";

export default function Test() {
  return <motion.div initial={{ opacity: 0 }}>Test</motion.div>;
}

tsconfig.json

{
  "compilerOptions": {
    "skipLibCheck": false,
    "strict": true
  }
}

Steps to reproduce

  1. Create a Next.js 15.5.7 project using React 19.2.1.
  2. Install motion@12.23.25 and @types/react@19.
  3. Import components from motion/react.
  4. Set "skipLibCheck": false in tsconfig.json.
  5. Run next build.
  6. TypeScript throws error TS2320 from Motion’s type definitions.

Expected behavior

TypeScript compilation should pass without errors when using Motion with React 19.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions