You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -47,7 +47,7 @@ You can skip this if you've run the codemod but in case not or you see some edge
47
47
48
48
> [!IMPORTANT]
49
49
>
50
-
> `framer-motion` library is now known as `motion/react`
50
+
> `framer-motion` library is now known as `motion/react`. We still use `framer-motion` imports in blade to support older versions.
51
51
>
52
52
> Checkout the [announcement by creator of framer-motion](https://bsky.app/profile/citizenofnowhe.re/post/3lar365ouuk2v)
53
53
@@ -59,10 +59,10 @@ You can skip this if you've run the codemod but in case not or you see some edge
59
59
We realised that several projects in razorpay are already using `framer-motion` and are on older versions.
60
60
To give some time to consumers to upgrade to framer-motion v11+, we'll be supporting framer-motion v4+ from blade. Although we will be dropping this support in next major version of blade so we recommend planning out framer-motion upgrade in coming quarter.
61
61
62
-
- **If you're on React 18**, migrating to framer-motion v11 should be fairly simple and low-effort. Checkout [Migrating from framer-motion v4+ to motion/react v11+](#migrating-from-framer-motion-v4-to-motionreact-aka-framer-motion-v11)
62
+
- **If you're on React 18**, migrating to framer-motion v11 should be fairly simple and low-effort. Checkout [Migrating from framer-motion v4+ to framer-motion v11+](#migrating-from-framer-motion-v4-to-motionreact-aka-framer-motion-v11)
63
63
- **For projects not on React 18 yet**, do plan out the upgrade soon to make sure future blade upgrades don't become blocker
64
64
65
-
#### Migrating from `framer-motion` v4+ to `motion/react` (aka `framer-motion` v11)
65
+
#### Migrating from `framer-motion` v4+ to `framer-motion` v11+
66
66
67
67
1. Ensure you're on React 18 as `framer-motion` v7 makes React 18 a minimum supported version.
68
68
a. [Checkout React 18 upgrade guide](https://react.dev/blog/2022/03/08/react-18-upgrade-guide) or use [React's official codemod for upgrading](https://github.com/reactjs/react-codemod)
@@ -75,35 +75,34 @@ These are mostly the changes you'll need if you're using core API. But if you're
75
75
76
76
### Setting Up Motion in New Projects
77
77
78
-
- #### Install `motion`
78
+
- #### Install `framer-motion`
79
79
80
80
```sh
81
-
yarn add motion --dev # or pnpm install motion --save-dev
81
+
yarn add framer-motion@^11 --dev # or pnpm install framer-motion --save-dev
82
82
```
83
83
84
-
- #### Setup reduced bundle version of `motion/react
84
+
- #### Setup reduced bundle version of `framer-motion`
85
85
86
86
##### If you're only using basic presets like `Fade`, `Move`, `Slide`, `Stagger`, `AnimateInteractions`, etc
87
87
88
88
```ts
89
89
// features.js
90
-
import { domAnimation } from 'motion/react';
90
+
import { domAnimation } from 'framer-motion';
91
91
export default domAnimation; // ~15kb
92
92
```
93
93
94
94
##### If you're using `Morph` or Layout animations of Motion React
95
95
96
96
```ts
97
97
// features.js
98
-
import { domMax } from 'motion/react';
98
+
import { domMax } from 'framer-motion';
99
99
export default domMax; // ~25kb (This includes domAnimation bundle as well so no need to import domAnimation again)
100
100
```
101
101
102
102
##### Lazy load into your App.js
103
103
104
104
```tsx
105
-
import { LazyMotion } from 'motion/react';
106
-
import { m } from 'motion';
105
+
import { LazyMotion, m } from 'framer-motion';
107
106
108
107
// Make sure to return the specific export containing the feature bundle.
0 commit comments