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

Warning: Accesing view manager configs for getConstants #742

Closed
abulnes16 opened this issue Aug 26, 2019 · 38 comments · Fixed by #1379
Closed

Warning: Accesing view manager configs for getConstants #742

abulnes16 opened this issue Aug 26, 2019 · 38 comments · Fixed by #1379

Comments

@abulnes16
Copy link

When using RNGH 1.4.1 with RN 0.60 the following warning appears:

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

The stack trace points at createHandler.js:39

@giautm
Copy link

giautm commented Aug 27, 2019

Same warning here, Expo SDKv34

Accessing view manager configs directly off UIManager via UIManager['getConstants'] is no longer supported. Use UIManager.getViewManagerConfig('getConstants') instead.
- node_modules/expo/build/environment/muteWarnings.fx.js:17:23 in warn
- node_modules/react-native/Libraries/ReactNative/UIManager.js:164:12 in get
- node_modules/react-native/Libraries/Utilities/defineLazyObjectProperty.js:42:18 in getValue
- node_modules/react-native-gesture-handler/createHandler.js:39:2 in <unknown>

@drnachio
Copy link

drnachio commented Sep 2, 2019

Any idea how I can we fix this?

@abulnes16
Copy link
Author

What i did was to change from expo to react-native init and the errror was gone

@hardrese7
Copy link

hardrese7 commented Sep 3, 2019

hey guys, just downgrade react-native-gesture-handler to 1.3.0.

You can directly change version in your package.json to ~1.3.0 and run npm i/yarn or remove it and install through expo how described here

@kimihiro64
Copy link

This was introduced with this commit.

It's not immediately clear whether overwriting UIManager.getConstants is even the right approach now that getViewManagerConfig is used... presumably to keep backwards compatibility you'd have to do both, but do a version check to prevent the warning on RN 60+.

@arekstryjski
Copy link

Downgrading react-native-gesture-handler to 1.3.0 didn't work for me :-(

@douglaszaltron
Copy link
Contributor

+1

@mauricioblum
Copy link

+1

@diekmrcoin
Copy link

diekmrcoin commented Sep 17, 2019

Hi, do we have any suggestions of how to fix this?

@Gl0ntz
Copy link

Gl0ntz commented Sep 19, 2019

+1 same warning
Downgrading react-native-gesture-handler does not work for me.

@diekmrcoin
Copy link

I fixed my project, as I am using expo, installing this package with expo install, this downgraded mine at my package.json to 1.3.* from 1.4.* and now it works as it should.

@eml-nx
Copy link

eml-nx commented Sep 19, 2019

Remove react-native-gesture-handler with npm / yarn and then expo install react-native-gesture-handler like @hardrese7 said

Compile..

@byCedric
Copy link
Contributor

byCedric commented Sep 20, 2019

Edit, you can now use expo install react-native-gesture-handler. It will take care of everything I listed below. 😁 (Don't forget to clean your cache with expo start --clear)


For anyone using Expo, brent pointed out a way to fix it. Basically, you need to install the specific versions listed here.

As of writing, the version required is ~1.3.0. Because NPM doesn't play nice with the tilde (~) you might have to edit it manually in your package.json.

But for those who want a quick fix, here are some commands that you can run to fix it.

// make sure you have the latest expo-cli (if you have >=3.1.0, you can skip this)
$ npm install -g expo-cli@latest

// remove your node_modules and package-lock.json (just to be sure)
$ rm -rf node_modules package-lock.json

// check if you have `react-native-gesture-handler` listed already (if so **remove it**)
$ cat package.json | grep react-native-gesture-handler

// use expo to install the appropriate version
$ expo install react-native-gesture-handler

// start expo with a clean cache
$ expo start --clear

@damechen
Copy link

For anyone using Expo, brent pointed out a way to fix it. Basically, you need to install the specific versions listed here. (as of writing, it's ~1.3.0, note the ~).

But for those who want a quick fix, here are some commands that you can run to fix it.

// make sure you have the latest expo-cli (if you have 3.1.0, you can skip this)
$ npm install -g expo@latest

// remove your node_modules and package-lock.json (just to be sure)
$ rm -rf node_modules package-lock.json

// check if you have `react-native-gesture-handler` listed already (if so **remove it**)
$ cat package.json | grep react-native-gesture-handler

// use expo to install the appropriate version
$ expo install react-native-gesture-handler

// start expo with a clean cache
$ expo start --clear

It worked for me. Thanks!

@expiante
Copy link

For anyone using Expo, brent pointed out a way to fix it. Basically, you need to install the specific versions listed here. (as of writing, it's ~1.3.0, note the ~).

But for those who want a quick fix, here are some commands that you can run to fix it.

// make sure you have the latest expo-cli (if you have 3.1.0, you can skip this)
$ npm install -g expo@latest

// remove your node_modules and package-lock.json (just to be sure)
$ rm -rf node_modules package-lock.json

// check if you have `react-native-gesture-handler` listed already (if so **remove it**)
$ cat package.json | grep react-native-gesture-handler

// use expo to install the appropriate version
$ expo install react-native-gesture-handler

// start expo with a clean cache
$ expo start --clear

Also worket for me, Thank you!

@naveedahmed986
Copy link

For anyone using Expo, brent pointed out a way to fix it. Basically, you need to install the specific versions listed here. (as of writing, it's ~1.3.0, note the ~).

But for those who want a quick fix, here are some commands that you can run to fix it.

// make sure you have the latest expo-cli (if you have >=3.1.0, you can skip this)
$ npm install -g expo@latest

// remove your node_modules and package-lock.json (just to be sure)
$ rm -rf node_modules package-lock.json

// check if you have `react-native-gesture-handler` listed already (if so **remove it**)
$ cat package.json | grep react-native-gesture-handler

// use expo to install the appropriate version
$ expo install react-native-gesture-handler

// start expo with a clean cache
$ expo start --clear

This solution worked for me. Thank alot.
expo-cli : 3.1.0
react-navigation : 4.0.8
react-native-gesture-handler: 1.3.0

@tafelito
Copy link

tafelito commented Oct 3, 2019

version 1.3.0 of react-native-gesture-handler does not support web and you can't use Touchables and also you get all the warnings that web is not supported

@baghel95
Copy link

baghel95 commented Oct 10, 2019

I'm using expo SDK version: "34.0.0"
and react-native-gesture-handler v 1.4.1 then I get warning,
use npm i react-native-gesture-handler@1.3.0 this worked

@SAABoy
Copy link

SAABoy commented Oct 11, 2019

Edit, you can now use expo install react-native-gesture-handler. It will take care of everything I listed below. 😁

For anyone using Expo, brent pointed out a way to fix it. Basically, you need to install the specific versions listed here.

As of writing, the version required is ~1.3.0. Because NPM doesn't play nice with the tilde (~) you might have to edit it manually in your package.json.

But for those who want a quick fix, here are some commands that you can run to fix it.

// make sure you have the latest expo-cli (if you have >=3.1.0, you can skip this)
$ npm install -g expo@latest

// remove your node_modules and package-lock.json (just to be sure)
$ rm -rf node_modules package-lock.json

// check if you have `react-native-gesture-handler` listed already (if so **remove it**)
$ cat package.json | grep react-native-gesture-handler

// use expo to install the appropriate version
$ expo install react-native-gesture-handler

// start expo with a clean cache
$ expo start --clear

This solution worked for me. Thanks.
expo: ^35.0.0
expo-cli : 3.3.0
react-navigation : ^3.11.0
react-native-gesture-handler: ^1.3.0

@enkemande
Copy link

hey guys, just downgrade react-native-gesture-handler to 1.3.0.

You can directly change version in your package.json to ~1.3.0 and run npm i/yarn or remove it and install through expo how described here

When you downgrade, it stops the react-native-gesture-handler Buttons from working

@diamont1001
Copy link

mark.
waiting for a new version to fix it.

@atifgulzar
Copy link

Edit, you can now use expo install react-native-gesture-handler. It will take care of everything I listed below. 😁

For anyone using Expo, brent pointed out a way to fix it. Basically, you need to install the specific versions listed here.

As of writing, the version required is ~1.3.0. Because NPM doesn't play nice with the tilde (~) you might have to edit it manually in your package.json.

But for those who want a quick fix, here are some commands that you can run to fix it.

// make sure you have the latest expo-cli (if you have >=3.1.0, you can skip this)
$ npm install -g expo@latest

// remove your node_modules and package-lock.json (just to be sure)
$ rm -rf node_modules package-lock.json

// check if you have `react-native-gesture-handler` listed already (if so **remove it**)
$ cat package.json | grep react-native-gesture-handler

// use expo to install the appropriate version
$ expo install react-native-gesture-handler

// start expo with a clean cache
$ expo start --clear

This solution worked for me. Thanks.

expo install react-native-gesture-handler ( This command install the same version ~1.3.0 for me ) but I guess running this command expo start --clear do the trick. :)

expo: ^35.0.0
react-navigation : ^4.0.10
react-native-gesture-handler: ~1.3.0

@vmheijke
Copy link

vmheijke commented Oct 18, 2019

Edit, you can now use expo install react-native-gesture-handler. It will take care of everything I listed below. 😁

For anyone using Expo, brent pointed out a way to fix it. Basically, you need to install the specific versions listed here.

As of writing, the version required is ~1.3.0. Because NPM doesn't play nice with the tilde (~) you might have to edit it manually in your package.json.

But for those who want a quick fix, here are some commands that you can run to fix it.

// make sure you have the latest expo-cli (if you have >=3.1.0, you can skip this)
$ npm install -g expo@latest

// remove your node_modules and package-lock.json (just to be sure)
$ rm -rf node_modules package-lock.json

// check if you have `react-native-gesture-handler` listed already (if so **remove it**)
$ cat package.json | grep react-native-gesture-handler

// use expo to install the appropriate version
$ expo install react-native-gesture-handler

// start expo with a clean cache
$ expo start --clear

Although using expo install above npm install solved a lot for me in other projects (thanks) i still have this issue. Even if i start a brand new expo-cli 3.4.4. project, I need to add gesture-handler since I want to use react-navigation and react-navigation-stack.

"expo": "^35.0.0",

"react": "16.8.3",
"react-dom": "16.8.3",
"react-native": "https://github.com/expo/react-native/archive/sdk-35.0.0.tar.gz",
"react-native-gesture-handler": "~1.3.0",
"react-native-web": "^0.11.7",
"react-navigation": "^4.0.10",
"react-navigation-stack": "^1.9.4"

@kimihiro64
Copy link

Any fix coming for people who /aren't/ using expo?

@devethan
Copy link

Remove react-native-gesture-handler with npm / yarn and then expo install react-native-gesture-handler like @hardrese7 said

Compile..

It works for me. Thank you.

@tonkunz
Copy link

tonkunz commented Nov 1, 2019

hey guys, just downgrade react-native-gesture-handler to 1.3.0.

You can directly change version in your package.json to ~1.3.0 and run npm i/yarn or remove it and install through expo how described here

Same for me... thank's

@itstrevinooo
Copy link

Edit, you can now use expo install react-native-gesture-handler. It will take care of everything I listed below. 😁

For anyone using Expo, brent pointed out a way to fix it. Basically, you need to install the specific versions listed here.

As of writing, the version required is ~1.3.0. Because NPM doesn't play nice with the tilde (~) you might have to edit it manually in your package.json.

But for those who want a quick fix, here are some commands that you can run to fix it.

// make sure you have the latest expo-cli (if you have >=3.1.0, you can skip this)
$ npm install -g expo@latest

// remove your node_modules and package-lock.json (just to be sure)
$ rm -rf node_modules package-lock.json

// check if you have `react-native-gesture-handler` listed already (if so **remove it**)
$ cat package.json | grep react-native-gesture-handler

// use expo to install the appropriate version
$ expo install react-native-gesture-handler

// start expo with a clean cache
$ expo start --clear

This worked for me, thanks!

@devethan
Copy link

devethan commented Nov 5, 2019

Edit, you can now use expo install react-native-gesture-handler. It will take care of everything I listed below. 😁
For anyone using Expo, brent pointed out a way to fix it. Basically, you need to install the specific versions listed here.

As of writing, the version required is ~1.3.0. Because NPM doesn't play nice with the tilde (~) you might have to edit it manually in your package.json.

But for those who want a quick fix, here are some commands that you can run to fix it.

// make sure you have the latest expo-cli (if you have >=3.1.0, you can skip this)
$ npm install -g expo@latest

// remove your node_modules and package-lock.json (just to be sure)
$ rm -rf node_modules package-lock.json

// check if you have `react-native-gesture-handler` listed already (if so **remove it**)
$ cat package.json | grep react-native-gesture-handler

// use expo to install the appropriate version
$ expo install react-native-gesture-handler

// start expo with a clean cache
$ expo start --clear

This worked for me, thanks!

Thanks. it helped me.
When I install same version of this module with npm or yarn, it still showed to me a same error message.
However, the error is no longer did not appear when I install the Expo.

@JaimeRamos99
Copy link

first run:
expo install react-native-gesture-handler
then run:
expo start --clear

@AntMooreWebDev
Copy link

first run:
expo install react-native-gesture-handler
then run:
expo start --clear

This did it for me. I had to run expo start --clear to clear the issue, after running the expo install command.

@Uttu316
Copy link

Uttu316 commented Nov 26, 2019

Downgrading react-native-gesture-handler to 1.3.0 didn't work for me :-(

I have the same version ~1.3.0 but still getting the error.

@Uttu316
Copy link

Uttu316 commented Nov 27, 2019

Downgrading react-native-gesture-handler to 1.3.0 didn't work for me :-(

did you find the solution?

@rada2292
Copy link

rada2292 commented Dec 5, 2019

This work for me,
First, delete the node_modules folder, then change the version of the handler in dependencies inside package.json like this:
"react-native-gesture-handler": "1.3.0"

After that, only run npm install and done.

Fixed

@randomtoni
Copy link

For me downgrading RNGH version did not solve the problem. This is the manual fix that fixed it for me:
Go to ./node-modules/react-native-gesture-handler/createHandler.js and replace the following):

if (UIManager.getConstants) {
  UIManager.getConstants().genericDirectEventTypes = {
    ...UIManager.getConstants().genericDirectEventTypes,
    ...customGHEventsConfig,
  };
}

to:

if (UIManager.getViewManagerConfig('getConstants')) {
  UIManager.getViewManagerConfig('getConstants').genericDirectEventTypes = {
    ...UIManager.getViewManagerConfig('getConstants').genericDirectEventTypes,
    ...customGHEventsConfig,
  };
}

Basically we're doing what the yellow message warned. Hope this help.

Note: this fix might be ignored by your git repo.

@dperez132213
Copy link

first run:
expo install react-native-gesture-handler
then run:
expo start --clear

This worked for me, thanks!

@Zlatanius
Copy link

Edit, you can now use expo install react-native-gesture-handler. It will take care of everything I listed below. 😁 (Don't forget to clean your cache with expo start --clear)

For anyone using Expo, brent pointed out a way to fix it. Basically, you need to install the specific versions listed here.

As of writing, the version required is ~1.3.0. Because NPM doesn't play nice with the tilde (~) you might have to edit it manually in your package.json.

But for those who want a quick fix, here are some commands that you can run to fix it.

// make sure you have the latest expo-cli (if you have >=3.1.0, you can skip this)
$ npm install -g expo@latest

// remove your node_modules and package-lock.json (just to be sure)
$ rm -rf node_modules package-lock.json

// check if you have `react-native-gesture-handler` listed already (if so **remove it**)
$ cat package.json | grep react-native-gesture-handler

// use expo to install the appropriate version
$ expo install react-native-gesture-handler

// start expo with a clean cache
$ expo start --clear

This actually worked. I cant believe it.

@stevenriok
Copy link

For me downgrading RNGH version did not solve the problem. This is the manual fix that fixed it for me:
Go to ./node-modules/react-native-gesture-handler/createHandler.js and replace the following):

if (UIManager.getConstants) {
  UIManager.getConstants().genericDirectEventTypes = {
    ...UIManager.getConstants().genericDirectEventTypes,
    ...customGHEventsConfig,
  };
}

to:

if (UIManager.getViewManagerConfig('getConstants')) {
  UIManager.getViewManagerConfig('getConstants').genericDirectEventTypes = {
    ...UIManager.getViewManagerConfig('getConstants').genericDirectEventTypes,
    ...customGHEventsConfig,
  };
}

Basically we're doing what the yellow message warned. Hope this help.

Note: this fix might be ignored by your git repo.

Thanks Mate, it's better solution than others

@rogger-frogger
Copy link

For those who cannot downgrade the library, you can hide the warning by doing:

YellowBox.ignoreWarnings(['Accessing view manager configs directly off UIManager via UIManager[\'getConstants\'] is no longer supported. Use UIManager.getViewManagerConfig(\'getConstants\') instead.']);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.