Reputation: 898
I have a React Native app that I generated using Expo. And when I installed react-native-reanimated
, it gave me this error. Do I have to configure something else with it?
Upvotes: 5
Views: 4853
Reputation: 453
react-native-web seems to only work with "react-native-reanimated": "2.9.1"
. Expo when upgrading will install "~2.12.0". This breaks web implementation. Downgrading reanimated was the only way I found to fix it.
yarn add [email protected]
or
npm i [email protected]
Upvotes: 4
Reputation: 41
Simply, include the plugin in babel.config.js
of the react native project as
@babel/plugin-proposal-export-namespace-from
,
react-native-reanimated/plugin
,
The full code of babel.config.js
is:
plugins: [
'@babel/plugin-proposal-export-namespace-from',
'react-native-reanimated/plugin',
]
This works correctly for the react native application running on web.
Upvotes: 4
Reputation: 984
Add babel plugin for react-native-reanimated
to your babel.config.js
as documented expo's official page:
module.exports = {
...
plugins: [
'react-native-reanimated/plugin',
'@babel/plugin-proposal-export-namespace-from',
'react-native-reanimated/plugin',
],
};
Upvotes: 5
Reputation: 119
Install react native reanimated
expo install react-native-reanimated
Upvotes: 0