React-native-gesture-handler: [1.0.14] Deprecation warnings with RN 0.58

Created on 25 Jan 2019  路  5Comments  路  Source: software-mansion/react-native-gesture-handler

When running RNGH 1.0.14 with RN 0.58 the following warning is displayed:

Accessing view manager configs directly off UIManager via UIManager['RCTView'] is no longer supported. Use UIManager.getViewManagerConfig('RCTView') instead.

The stack trace points at GestureHandler.js:46

Most helpful comment

The master branch version of GestureHandler.js still seems to require WebView, so I'm guessing the fix is either in a separate branch or hasn't been pushed yet?

All 5 comments

Another one from GestureHandler.js:717:

WebView has been extracted from react-native core and will be removed in a future release. It can now be installed and imported from 'react-native-webview' instead of 'react-native'. See https://github.com/react-native-community/react-native-webview for more informations.

https://github.com/kmagiera/react-native-gesture-handler/commit/35c57a0f4930210c3b152e33e814e97ec1e23d92 fixes the first one in [email protected], but the second one is still extant as of this comment.

Not sure exactly what to do for that one. Probably removing WrappedWebView as an export would make the most sense, but perhaps it could be moved to a specific file that isn't require by the index? So it could be required by accessing the specific file directly, but wouldn't be touched otherwise.

I installed and linked react-native-webview into my main project, and then I changed the import statement in GestureHandler.js to

import {WebView} from 'react-native-webview';

and it seemed to work just fine, deprecation warning went away.

Would this be a valid solution? It does of course require installing react-native-webview and linking it. Could it be done in the react-native-gesture-handler project itself?

All these issues has been fixed and will be released soon

The master branch version of GestureHandler.js still seems to require WebView, so I'm guessing the fix is either in a separate branch or hasn't been pushed yet?

Was this page helpful?
0 / 5 - 0 ratings