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.

Button component generate warning

See original GitHub issue

Description

Using react native button on iOS create the following warning:

Animated: `useNativeDriver` is not supported because the native animated module is missing. Falling back to JS-based animation. To resolve this, add `RCTAnimation` module to this app, or remove `useNativeDriver`.

Reproduction

Step 1: Add a button in your view, Step 2: Launch the iOS simulator Step 3: Click on the button and see the warning.

capture d ecran 2016-11-23 a 11 23 53 capture d ecran 2016-11-23 a 11 23 57

If it can help, you can find the code here: https://github.com/adrienbataille/test-react-native

Note: I don’t have this problem on Android

Solution

After a little investigation, I found the button component is based on TouchableOpacity for iOS and react-native release notes for 0.38.0 mention this commit: https://github.com/facebook/react-native/commit/1bb323e256bb6ad7b9f757368e69cf682f71d7ac. I don’t if it the origin of the problem, but may be it can have an impact, because it works fine with react-native 0.37.0.

Additional Information

  • React Native version: 0.38.0
  • Platform: iOS
  • Operating System: MacOS - Sierra

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:11
  • Comments:36 (1 by maintainers)

github_iconTop GitHub Comments

269reactions
henrikracommented, Jan 27, 2017

You need to link RCTAnimation like @sibelius said.

Here is how I did it:

  1. find RCTAnimation.xcodeproj The file can be found from node_modules/react-native/NativeAnimation OR node_modules/react-native/Libraries/NativeAnimation
  2. open xcode
  3. open project navigator (press cmd + 1 OR click folder icon from the left)
  4. drag & drop RCTAnimation.xcodeproj from the previous step to Libraries folder
  5. Expand RCTAnimation.xcodeproj in project navigator and find libRCTAnimation.a file inside of Products folder
  6. click on your project name on top of project navigator and go to Build Phrases tab
  7. drag and drop libRCTAnimation.a to Link Binary With Libraries
  8. Clean and run 😃

I hope this works for you 😃

29reactions
knygacommented, Dec 3, 2016

The correct path for RCTAnimation is ./node_modules/react-native/Libraries/NativeAnimation/RCTAnimation.xcodeproj

Read more comments on GitHub >

github_iconTop Results From Across the Web

Alerts - Presentation - Human Interface Guidelines - Design
In all platforms, alerts display a title, optional informative text, and up to three buttons. On some platforms, alerts can include additional elements....
Read more >
Create a custom React alert message - LogRocket Blog
Review popular frameworks for building alert messages in React, then build your own custom alert message from scratch.
Read more >
ion-alert: Ionic API Alert Buttons with Custom Message Prompts
ion-alert dialog presents or collects information using inputs. Custom alert button messages appear above the app's content and must be manually dismissed.
Read more >
Buttons - Lightning Design System
To create the brand button, add the slds-button_brand class to the slds-button class. The brand color tokens can be overridden for theme specific...
Read more >
Button | Components - BootstrapVue
BootstrapVue's <b-button> component generates either a <button> element, ... primary , secondary , success , danger , warning , info , light and...
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