question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Animated: useNativeDriver was not specified. This is a required option and must be explicitly set to true or false in ActionSheet (at SignUp_1.tsx:107) in SignUp_Name (at SceneView.tsx:98) in SceneView (at useDescriptors.tsx:125) in CardContainer (at CardStack.tsx:531) in CardStack (at StackView.tsx:420) in KeyboardManager (at StackView.tsx:418) in Context.Consumer (at StackView.tsx:416) in StackView (at createStackNavigator.tsx:67) in StackNavigator (at navigation/​index.tsx:27) in LoginStackScreen (at SceneView.tsx:98) in SceneView (at useDescriptors.tsx:125) in CardContainer (at CardStack.tsx:531) in CardStack (at StackView.tsx:420) in KeyboardManager (at StackView.tsx:418) in Context.Consumer (at StackView.tsx:416) in StackView (at createStackNavigator.tsx:67) in StackNavigator (at navigation/​index.tsx:184) in MainStackScreen (at navigation/​index.tsx:215) in AppNavigation (at App.tsx:27) in App (at renderApplication.js:45)

react native 0.62

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:7
  • Comments:11

github_iconTop GitHub Comments

5reactions
asasouzacommented, Jun 3, 2020

@pke This is the patch file:

index 7a0fc35..d409f70 100644
--- a/node_modules/react-native-actionsheet/lib/ActionSheetCustom.js
+++ b/node_modules/react-native-actionsheet/lib/ActionSheetCustom.js
@@ -24,8 +24,9 @@ class ActionSheet extends React.Component {
     }
   }
 
   get styles () {
@@ -68,14 +69,16 @@ class ActionSheet extends React.Component {
     Animated.timing(this.state.sheetAnim, {
       toValue: 0,
       duration: 250,
-      easing: Easing.out(Easing.ease)
+      easing: Easing.out(Easing.ease),
+      useNativeDriver: true,
     }).start()
   }
 
   _hideSheet (callback) {
     Animated.timing(this.state.sheetAnim, {
       toValue: this.translateY,
-      duration: 200
+      duration: 200,
+      useNativeDriver: true,
     }).start(callback)
   }

I created it by using the package patch-package, available in npm. All you need to do is install the patch-package in you project, or globally, and add in the postinstall script in your package.json npx patch-package. After this, just edit the ActionSheetCustom.js and run npx patch-package react-native-actionsheet and done, it will create a folder with the package and every npm install execution will trigger the postinstall that applies the changes; Sorry if my explanation is not enough, english is not my primary language. If you still have doubts I strongly recommend the docs from the package;

3reactions
aprilmintacpinedacommented, Sep 28, 2020

Yeah, I got this error as well, just use patch-package,

Install

npm i -S patch-package

Then add

"script": {
  // ... other scripts
  "postinstall": "patch-package" // <--- add this line
}

to your package.json.

Edit file

Go to node_modules/react-native-actionsheet/lib/ActionSheetCustom.js

Replace the _hideSheet on like 76 with the following:

_hideSheet (callback) {
  Animated.timing(this.state.sheetAnim, {
    toValue: this.translateY,
    duration: 200,
    useNativeDriver: true
  }).start(callback)
}

also the _showSheet on line 67 with the following:

_showSheet = () => {
  Animated.timing(this.state.sheetAnim, {
    toValue: 0,
    duration: 250,
    easing: Easing.out(Easing.ease),
    useNativeDriver: true
  }).start()
}

Bonus

On render method, on the <Modal> render, change the animationType="none" to animationType="fade", this will gracefully open the modal instead of it popping right away.

patch it up

run npx patch-package

Then you’re all set.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using Native Driver for Animated
For normal animations the answer is simple, just add useNativeDriver: true to the animation config when starting it. Before:.
Read more >
Animated: `useNativeDriver` was not specified issue of ...
It gives a warning message: Animated: useNativeDriver was not specified. This is a required option and must be explicitly set to true or...
Read more >
Using 'useNativeDriver' in react-native animations effectively
React-native allows us to easily create beautiful animations easily using the Animated class. However, unless we specify 'useNativeDriver' ...
Read more >
#8: useNativeDriver - React Native Animations - YouTube
Let's explore what useNativeDriver is and how it works!------------Don't forget to subscribe and like the video if you enjoyed :)Be a damner ...
Read more >
What are the differences between using useNativeDriver and ...
If I understood correctly useNativeDriver from React Native's built in Animated API makes the animations run on the UI thread First ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found