title: Occasional 403 CSRF error in React Native WebView
body: <p>I am loading a form (powered by Django) in a React Native app using <code>react-native-webview</code>. This form has CSRF protection. And most of the time it actually works fine, you can submit the form in the app through the webview and everything is fine. But sometimes I get a 403 CSRF error (CSRF verification failed, Request aborted).</p>
  <p>I'm not sure what could be causing this and how could it be avoided? I'm using the <code>WebView</code> in a fairly straightforward way with a wrapper around it.</p>
  <p>If there was a network connection issue on the mobile phone then I would probably get a timeout error instead right, not something specific like this?</p>
  <pre><code>import { WebView as BaseWebView } from 'react-native-webview';
  
  const FullScreenWebView = styled(BaseWebView)`
    flex: 1;
  `;
  ...
  export const WebView: FC&lt;WebViewProps&gt; = props =&gt; {
  ...
  return (
      &lt;Layout.Root&gt;
        {url.startsWith('/') ? (
          &lt;Layout.LoadingFlex1 /&gt;
        ) : (
          &lt;FullScreenWebView
            ref={webviewRef}
            source={{ uri: urlWithLang }}
            startInLoadingState={true}
            onShouldStartLoadWithRequest={globalZendeskIntercept}
            // only allow secure webviews and those for our deeplink scheme
            originWhitelist={['https://', `${Config.DEEPLINK_SCHEME}://`]}
            decelerationRate=&quot;normal&quot;
            allowsBackForwardNavigationGestures
            onNavigationStateChange={navState =&gt; {
              if (navState.canGoBack) {
                setCanGoBack(true);
              } else {
                setCanGoBack(false);
              }
            }}
          /&gt;
        )}
      &lt;/Layout.Root&gt;
    );
  };
  </code></pre>