Closed dochonglo closed 3 years ago
@ismaelbarry: hello! :wave:
This issue is being automatically closed because it does not follow the issue template.
@ismaelbarry follow the installation instructions https://docs.swmansion.com/react-native-reanimated/docs/2.2.0/installation
@gorhom - Thanks for reaching out and helping!
I've followed their installation guide; however, I'm still having the same problem. Below are the steps that I took:
npm install --save react-native-reanimated@2.3.0-alpha.1
cd iOS && pod install
babel.config.js
file.Unfortunately, I'm still getting the same type of error message that's pointing me to certain functions that are already market as worklets. Here's the error
Also, I chose not to use the npm install --save react-native-reanimated@next
because it was installing v2.2.0
and as per the docs you linked, that version is no longer maintained.
Finally, here's the updated environment info:
Library | Version |
---|---|
@gorhom/bottom-sheet | ^3.6.6 |
react-native | ^0.64.2 |
react-native-reanimated | ~2.3.0-alpha.1 |
react-native-gesture-handler | ~1.10.2 |
react-navigation | ^4.0.10 |
react-navigation-stack | ^1.10.3 |
react-navigation-tabs | ^2.6.2 |
react-native-screens | ~3.0.0 |
Same issue here..
@gorhom Would it be possible to reopen this issue? I encountered the same error while using Expo as platform and I believe it is not 100% fixed.
Same issue, I followed the installation instructions https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/installation/ here but no help
Bug
Unfortunately, I'm receiving the following error on any screen that imports and uses the
BottomSheetScrollView
andBottomSheetBackdrop
.I've been able to pinpoint the error message to my
node_modules/react-native-reanimated/src/reanimated2/Hooks.ts (225.0)
Below are the contents of my Hooks.ts file, where the error is occurring. Interestingly, the function is marked as a
worklet
.`function styleUpdater( viewDescriptor, updater, state, maybeViewRef, adapters, animationsActive ) { 'worklet' const animations = state.animations || {}; const newValues = updater() || {}; const oldValues = state.last;
// extract animated props let hasAnimations = false; Object.keys(animations).forEach((key) => { const value = newValues[key]; if (!isAnimated(value)) { delete animations[key]; } }); Object.keys(newValues).forEach((key) => { const value = newValues[key]; if (isAnimated(value)) { prepareAnimation(value, animations[key], oldValues[key]); animations[key] = value; hasAnimations = true; } });
function frame(timestamp) { const { animations, last, isAnimationCancelled } = state; if (isAnimationCancelled) { state.isAnimationRunning = false; return; }
}
if (hasAnimations) { state.animations = animations; if (!state.isAnimationRunning) { state.isAnimationCancelled = false; state.isAnimationRunning = true; if (_frameTimestamp) { frame(_frameTimestamp); } else { requestFrame(frame); } } } else { state.isAnimationCancelled = true; state.animations = {}; }
// calculate diff const diff = styleDiff(oldValues, newValues); state.last = Object.assign({}, oldValues, newValues);
if (Object.keys(diff).length !== 0) { updateProps(viewDescriptor, diff, maybeViewRef, adapters); } }`
Finally, the following is my babel.config.js file:
module.exports = function (api) { api.cache(true); if ( process.env.NODE_ENV === "production" || process.env.BABEL_ENV === "production" ) { return { presets: ["babel-preset-expo", "module:metro-react-native-babel-preset"], plugins: [ "react-native-paper/babel", ["transform-remove-console", { exclude: ["error", "warn", "info"] }], "react-native-reanimated/plugin", ], }; } else { return { presets: ["babel-preset-expo", "module:metro-react-native-babel-preset"], plugins: ["react-native-reanimated/plugin"], }; } };
Environment info
Steps To Reproduce
Followed the steps to install gorhom/bottom-sheet in my ejected expo app.
Describe what you expected to happen:
BottomSheetScrollView
andBottomSheetBackdrop