title: How can I mock react-native-webview reload function?
body: <p>I'm trying to create a unit test for a component in which I have a WebView.</p>
  <p>The problem is that inside this component I call the reload() function of the WebView.</p>
  <p>And when I run the test I get this error:</p>
  <pre><code> Invariant Violation: nodeHandle expected to be non-null
  
        107 |     useCallback(() =&gt; {
        108 |       if (navigation.getState().index === 0) {
      &gt; 109 |         webviewRef.current.reload();
            |                            ^
        110 |       }
        111 |     }, [webviewRef, navigation])
        112 |   );
  </code></pre>
  <p>I tried to mockup the reload() function following an example that I've found on Jest site in this way:</p>
  <pre><code>jest.mock('react-native-webview', () =&gt; {
    const RealComponent = jest.requireActual('react-native-webview');
    RealComponent.reload = jest.fn();
    return RealComponent;
  });
  </code></pre>
  <p>But I'm getting the exact same error message. It seems that jest isn't picking my mockup.</p>
  <p>How can I mockup the reload() function of WebView?</p>