title: Validating Undefined in React Native
body: <p>I have a situation where I'm trying to pass some params via <code>onPress</code> to another screen. However I'm unable to capture the Undefined state and it gives me the red screen error - </p>
  
  <blockquote>
    <p>Type Error: undefined is not an object.</p>
  </blockquote>
  
  <p>Here's my snippet. Am I missing something?</p>
  
  <pre><code>const pressHandle = (item) =&gt; {
          const capVal = state.payload.find((grabVal) =&gt; grabVal.jobId === item.jobId).jobId;
  
          console.log(capVal); // in a defined case, I have a log so the query is correct.
  
          if( typeof(capVal) !== undefined || typeof(capVal) != null ) {
              setGrabber(capVal);
          } else {
              setGrabber('undefined!');
          }
          console.log(grabber);
  }
  </code></pre>