36得票19回答
在使用create-react-app创建React项目时,导入Framer Motion v5出现错误。

当我尝试使用Framer Motion对div进行简单动画时,在浏览器中出现以下错误: /node_modules/framer-motion/dist/es/components/AnimatePresence/index.mjs Can't import the named expor...

26得票3回答
使用Framer-motion在鼠标悬停在父元素上时为子元素添加动画效果

使用 Framer Motion,我想要在鼠标悬停在父元素(一个按钮)上时,将我的 Icon 组件旋转 90 度。 <motion.button type="button" whileHover={{scale: 1.1}}> Visit our Industry ...

19得票2回答
使用react-testing-library和framer-motion如何测试鼠标移动拖放?

我正在尝试使用react-testing-library测试拖放功能。拖放功能来自framer-motion,代码是用react写的。据我所了解,它使用mousedown、mousemove和mouseup事件来实现。我想测试以下基本组件的拖放功能:export const Draggable...

17得票2回答
当元素在视野中时(滚动到元素时),Framer Motion会进行动画处理。

是否有内置的方法可以使动画在元素进入视图时开始(例如,当我们滚动到元素时)? Framer Motion 有一个装载动画(mount animations)部分,其中说: 当组件安装时,如果animate中的值与style或initial中定义的值不同,则它们将自动动画化。 所以...

16得票1回答
动画效果退出不起作用,使用 Framer Motion。

动画存在的 退出 属性无法正常工作。我做错了什么? <AnimatePresence> <motion.div initial={{ opacity: 0, x: "-100%" }} animate={{ opacity: ...

15得票1回答
Framer Motion退出动画在带有react-router-dom的手风琴上没有触发

我已经使用一种非传统的标记结构,通过react-router-dom实现了这个手风琴布局。 演示: https://codesandbox.io/s/falling-violet-kvqn2?file=/src/Case.js 一个手风琴标题的简短代码: <motion.div...

13得票5回答
如何在React中使用Framer Motion和Material-UI?(@material-ui/core)

我想知道是否有一种方法可以将framer-motion与Material-Ui一起使用。 我尝试过但没有成功。

12得票2回答
如何在 Next.js 中实现加载屏幕

我是Next.js的新手,正在使用nextjs v9.3、next-redux-wrapper v5、@material-ui/core v4.2和custom express server。 我正在尝试在我的Next.js应用程序中实现路由切换时的加载屏幕,因此我正在使用framer mo...

11得票4回答
Type '{ children: Element; }'与类型'IntrinsicAttributes&AnimatePresenceProps'没有共同的属性。ts(2559)

这个错误突然开始出现: 但是如果我创建一个包裹组件,将props展开并引入子组件,则不会出现错误:const WorkingVersion = (props: {id?: number}) => <SimpleComponent {...props}><div>...

11得票3回答
使用Framer Motion的staggerChildren技术

我在使用Framer Motions的"staggerChildren"动画过渡效果时遇到了一些问题,它可以让子组件的动画错开。 我已经为父容器和子元素设置了如下的动画属性:const container = { hidden: { opacity: 0 }, show: { ...