Closed nandorojo closed 1 year ago
Another update is live at 0.21.1-alpha.9
, which adds fixes for MotiPressable
.
Hermes support was pulled in as well.
will this bring back the bundle size problem ?
It shouldn’t affect that. That all lies in how they tree shake Reanimated
I opened a PR to fix this at reanimated once and for all: https://github.com/software-mansion/react-native-reanimated/pull/3997
Making an issue here for visibility.
Workaround
yarn add moti@swc
(This installs0.21.1-alpha.6
at the time of writing)Add this at the top of
pages/_app.tsx
:next.config.js
(until it's fixed).Overview
I created a reproduction here of Reanimated not working with SWC: https://github.com/nandorojo/reanimated-next13-issue
Here's the Next.js issue: https://github.com/vercel/next.js/issues/43886 And the Reanimated issue: https://github.com/software-mansion/react-native-reanimated/issues/3971
Expected Behavior
Reanimated should work on Next.js. Due to its architecture, this requires an SWC plugin. However, the plugin is not working.
If you use Reanimated without a plugin, it doesn't break anything, but animations don't usually run. However, On the
swc-hack
branch, I figured out a way to get Reanimated working on Web without a plugin.The result will not affect native, only Web (when enabled). The solution adds re-renders to power animations. It shouldn't be noticeable.
Steps To Reproduce
No response
Versions
Screenshots
Reproduction
https://github.com/nandorojo/reanimated-next13-issue