Skip to content

Commit 3fad7bc

Browse files
Update deprecated getConstants() call (#1379)
This removes the React Native warning: *Accessing view manager configs directly off UIManager via UIManager['getConstants'] is no longer supported. Use UIManager.getViewManagerConfig('getConstants') instead.*
1 parent 0c54818 commit 3fad7bc

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/handlers/createHandler.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@ UIManager.genericDirectEventTypes = {
4343
...customGHEventsConfig,
4444
};
4545
// In newer versions of RN the `genericDirectEventTypes` is located in the object
46-
// returned by UIManager.getConstants(), we need to add it there as well to make
46+
// returned by UIManager.getViewManagerConfig('getConstants'), we need to add it there as well to make
4747
// it compatible with RN 61+
48-
if (UIManager.getConstants) {
49-
UIManager.getConstants().genericDirectEventTypes = {
50-
...UIManager.getConstants().genericDirectEventTypes,
48+
if (UIManager.getViewManagerConfig) {
49+
UIManager.getViewManagerConfig('getConstants').genericDirectEventTypes = {
50+
...UIManager.getViewManagerConfig('getConstants').genericDirectEventTypes,
5151
...customGHEventsConfig,
5252
};
5353
}

0 commit comments

Comments
 (0)