title: Override back press react native router flux
body: <p>I am using react native router flux in my react native app. I want to override the back button press event as I want to add confirmation popup before going back. I have searched a lot but all the links I found was for overriding hardware back button press of Android. I not only want to override the hardware back press but also want to override the back button press event in the navigation bar (for both Android and iOS). Please help me out here.</p>
  
  <p><strong>Edit:</strong> I found one way to override the back press event by adding two props in my scene <code>back</code> and <code>onBack</code>. But now problem is I want this backpress to be conditional. I am passing a boolean prop <code>edit</code> to this scene. If the edit is true then only I want to override the backpress otherwise I just want the default one. So how can I change the Scene parameter in my Router.js using the props being passed to that scene?</p>
  
  <p>sudo code</p>
  
  <pre><code>if(edit){
     openConfirmationDialog();
  } else {
     Actions.pop();
  }
  </code></pre>