Dark Mode

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

TypeError: _reactNative.AppState.removeEventListener is not a function #134

Open
Open
TypeError: _reactNative.AppState.removeEventListener is not a function#134

Description

If there isn't an update available or if the update doesn't fix the issue, you can manually patch the library by updating how AppState listeners are added and removed.

Steps to Manually Patch the Library:
Locate the node_modules/react-native-countdown-component/index.js file.
Find instances of AppState.addEventListener and AppState.removeEventListener.
Replace them with the updated API as follows:

Replace:
AppState.addEventListener('change', this._handleAppStateChange);

with:
this.appStateSubscription = AppState.addEventListener('change', this._handleAppStateChange);

Also Replace:
AppState.removeEventListener('change', this._handleAppStateChange);

with:
this.appStateSubscription && this.appStateSubscription.remove();

Save the file and re-run your project.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions