繁体   English   中英

导入 framer-motion 时出错

[英]Error occurs when importing framer-motion

安装 framer-motion 并导入 { Frame, useMotionValue, useTransform } from 'framer';。 但是,我收到以下错误。

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

您安装了 framer-motion 对吗? 然后你将不得不从那个库本身导入!

你这样做:

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

后:

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

你误解了“framer-motion”和“framer”

暂无
暂无

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

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