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

Avoid removeEventListener Warning #110

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Lamonarch87
Copy link

@Lamonarch87 Lamonarch87 commented Aug 1, 2022

AppState.removeEventListener is now deprecated.
In this way you'll receive no warnings.

AppState.removeEventListenere is now deprecated.
In this way you'll receive no warnings.
@@ -43,6 +43,7 @@ class CountDown extends React.Component {
until: Math.max(this.props.until, 0),
lastUntil: null,
wentBackgroundAt: null,
appStateSubscription: null
Copy link

@miguelzabalaf miguelzabalaf Sep 20, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Lamonarch87
If you use TypeScript in your project, assign this PropType to appStateSubscription, to avoid warnings when rendering the component:

appStateSubscription: PropTypes.oneOfType([PropTypes.func, PropTypes.object])

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 this pull request may close these issues.

2 participants