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

Does handleInactivity need to be called in componentWillMount()? #14

Closed
germainc opened this issue Apr 16, 2019 · 2 comments
Closed

Does handleInactivity need to be called in componentWillMount()? #14

germainc opened this issue Apr 16, 2019 · 2 comments

Comments

@germainc
Copy link

In my current use case, I don't want onAction to fire when the component mounts. Could we add a prop that allows that call to be skipped? I'm guessing clearTimer and resetTimeout would have to be called instead.

Also, componentWillMount is deprecated so this should probably be moved to componentDidMount.

@jkomyno
Copy link
Owner

jkomyno commented Jul 23, 2019

Hi, thank you for pointing out that componentWillMount is deprecated, I won't need it anymore since
I'm moving this package to hooks (#18).
At the moment, the package triggers the onAction property when the component mounts, which - I must admit - isn't the most intuitive behavior. So actually it would make more sense if I changed the package to prohibit triggering onAction at first-render time.
The new version of react-native-user-inactivity should be out the 13th August 2019

@jkomyno
Copy link
Owner

jkomyno commented Oct 11, 2019

Hi, please check out the new version. You need to provide a custom timer to the library. In your case, just use any native background timer that works on Android too. Sorry for the delay, I just completed my bachelor's and my mind was elsewhere during these months.

@jkomyno jkomyno closed this as completed Oct 11, 2019
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

No branches or pull requests

2 participants