Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

React-native-paper TextInput show 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. #2455

Closed
1 task done
threemak opened this issue Dec 20, 2022 · 1 comment
Labels

Comments

@threemak
Copy link

threemak commented Dec 20, 2022

Is there an existing issue for this?

  • I have searched the existing issues

Describe the issue

React native web

Expected behavior

I check this file https://github.com/necolas/react-native-web/blob/master/packages/react-native-web/src/vendor/react-native/Animated/NativeAnimatedHelper.js

var _warnedMissingNativeAnimated = false;
export function shouldUseNativeDriver(config) {
  if (config.useNativeDriver == null) {
    console.warn('Animated: `useNativeDriver` was not specified. This is a required ' + 'option and must be explicitly set to `true` or `false`');
  }

  if (config.useNativeDriver === true && !NativeAnimatedModule) {
    if (!_warnedMissingNativeAnimated) {
      console.warn('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`. ' + 'Make sure to run `pod install` first. Read more about autolinking: https://github.com/react-native-community/cli/blob/master/docs/autolinking.md');
      _warnedMissingNativeAnimated = true;
    }

    return false;
  }

  return config.useNativeDriver || false;
}

When I remove ! sign it disappear the warning

Steps to reproduce

"dependencies": {
"@expo/vector-icons": "^13.0.0",
"@expo/webpack-config": "^0.17.2",
"@react-navigation/native": "^6.1.1",
"@react-navigation/native-stack": "^6.9.6",
"D": "^1.0.0",
"expo": "~47.0.8",
"expo-font": "~11.0.1",
"expo-splash-screen": "~0.17.5",
"expo-status-bar": "~1.4.2",
"jest": "^26.6.3",
"jest-expo": "^47.0.1",
"nativewind": "^2.0.0-next.65",
"react": "18.1.0",
"react-dom": "18.1.0",
"react-fast-compare": "^3.2.0",
"react-native": "0.70.5",
"react-native-gesture-handler": "~2.8.0",
"react-native-paper": "^5.0.1",
"react-native-reanimated": "~2.12.0",
"react-native-safe-area-context": "4.4.1",
"react-native-screens": "~3.18.0",
"react-native-web": "~0.18.9",
"resize-observer-polyfill": "^1.5.1"
},
"devDependencies": {
"@babel/core": "^7.12.9",
"@babel/plugin-proposal-export-namespace-from": "^7.18.9",
"@types/react": "~18.0.14",
"@types/react-native": "~0.70.6",
"autoprefixer": "^10.4.13",
"babel-preset-expo": "^9.2.2",
"cross-env": "^7.0.3",
"postcss": "^8.4.20",
"postcss-loader": "^4.2.0",
"sharp-cli": "^2.1.0",
"tailwindcss": "^3.2.4",
"typescript": "^4.6.3"
},

Test case

https://codesandbox.io/s/6lx6ql1w5r

Additional comments

No response

@threemak threemak added the bug label Dec 20, 2022
@necolas
Copy link
Owner

necolas commented Dec 20, 2022

The warning let's you know that animations are using JS on web because there is no native driver. This isn't a bug. But a future version of Animated could potentially use Web Animations API for better performance

@necolas necolas closed this as completed Dec 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants