Back Handler not working

I’m having trouble implementing Back handler in my expo project. Any reason why its not working?

    BackHandler.addEventListener('hardwareBackPress', this.handleBackPress);

      BackHandler.removeEventListener('hardwareBackPress', this.handleBackPress);

  handleBackPress = async () => {
      return true;
1 Like

Hey @productivenyc,

Can you elaborate on what you mean by “its not working”? Always hard to help out without more information.



1 Like

Thats fair.

It doesn’t call the function. Also not sure why I had it async but it doesn’t work either way.

Gotcha. This page may be of use to:

Specifically the last section regarding React Lifecycles.


Im pretty sure I tried moving the addListener into the constructor. No change. But ill try again.

BTW I’m using react navigation so I’m pretty sure I copied that example actually

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.