Skip to content

Warning EventEmitter.removeListener('change', ...) has been deprecated #1582

Closed
@AkshatShetty101

Description

@AkshatShetty101

Describe the bug

Not exactly a bug but a warning is created while using buttons

EventEmitter.removeListener('change', ...): Method has been deprecated. Please instead use `remove()` on the subscription returned by `EventEmitter.addListener`.

To Reproduce

  1. Create a basic button (https://github.com/wix/react-native-ui-lib/blob/master/demo/src/screens/componentScreens/ButtonsScreen.tsx)
  2. Add to any app and click it
  3. Check logs for warnings

Expected behavior

No warnings

Code snippet

Based on my logs the warning is being triggered due to this line: https://github.com/wix/react-native-ui-lib/blob/master/src/helpers/Constants.ts#L134

Device (please complete the following information)

Not a device specific issue
Tested on an Android Emulator - Pixel XL (Android 10 (API level 29))
React Native - 0.65

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions