React Native AppState not working in android with blur event

Viewed 203

Blur and focus events from AppState don't come when I pull-down menu on android and I can't find any use case to trigger it. Does someone know how to fix this and why it's not working? I have tried simulator in expo online editor and the same problem persists. React native version 0.63.3. This is my code:

  const onBlur = () => {
    console.log('blur is working')
  }

  useEffect(() => {
    if (Platform.OS === 'android') {
      AppState.addEventListener('blur', onBlur)
    }
    return () => {
      if (Platform.OS === 'android') {
        AppState.removeEventListener('blur', onBlur)
      }
    }
  }, [])
0 Answers
Related