简体   繁体   English

导入 framer-motion 时出错

[英]Error occurs when importing framer-motion

Install framer-motion and import { Frame, useMotionValue, useTransform } from 'framer';.安装 framer-motion 并导入 { Frame, useMotionValue, useTransform } from 'framer';。 However, I get the following error.但是,我收到以下错误。

Cannot find module 'framer' or its corresponding type declarations.ts(2307)

You installed framer-motion right?您安装了 framer-motion 对吗? Then you will have to import from that lib itself!然后你将不得不从那个库本身导入!

You do like this:你这样做:

import { Frame, useMotionValue, useTransform } from "framer-motion"
npm i framer-motion

after:后:

import { useMotionValue, useTransform } from "framer-motion"
import { Frame } from "framer"

You misunderstood "framer-motion" and "framer"你误解了“framer-motion”和“framer”

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM