jkomyno/react-native-user-inactivity

Error: Attempted to remove more RTCKeyboardObserver Listeners than needed

Chiinyee opened this issue · 4 comments

Context:
React native 0.62.2
iOS 13

How i implemented:

const logout = () => {
props.navigation.navigate('Splash')
}

<UserInactivity
isActive={active}
timeForInactivity={timer}
onAction={isActive => { isActive ? console.log("I'm active") : logout() }}>

// App components

I am attempting to use this library to detect for user inactivity and if the user is inactive, I would like to log the user out of the app. When the logout() method is called and the page is routed to splash, I get the following error: Attempted to remove more RTCKeyboardObserver Listeners than needed. May I know if this is a problem due to the library?

Screenshot 2020-06-12 at 3 06 36 PM

You can use skipKeyboard={true} while the issue is fixed

<UserInactivity isActive={active} timeForInactivity={timer} onAction={isActive => { isActive ? console.log("I'm active") : logout() }} skipKeyboard={true}>

Hi @Chiinyee, can you please provide a minimal example Expo application with the issue you're describing?

I got same problem in my application, and I can confirm that adding skipKeyboard={true} solves the problem.

EDIT: I've actually checked code and know what causes the issue, will make a PR in a sec

Hi to all, react-native-user-inactivity@1.2.0 is out with this update.