title: passing my function to useeffect crashes my app
body: <p>Hi Im trying to implement openpay services to my react native app but when i try to generate the TokenID from the credit card info i got problems with the use effect</p>
  <p>this is the code</p>
  <pre><code> useEffect(() =&gt; {
  let isCancelled = false;
  if (vCardNameOwner &amp;&amp; vCardNumber &amp;&amp; vCardExpirationMonth &amp;&amp; vCardExpirationYears &amp;&amp; vCardCVV) {
  openpay.createCardToken({
      holder_name: vCardNameOwner,
      card_number: vCardNumber,
      expiration_month: vCardExpirationMonth,
      expiration_year: vCardExpirationYears,
      cvv2: vCardCVV,
     })
        .then((token) =&gt; setvTokenId(token), console.log( '/////generacion de token//////' ,token));
      }
        return () =&gt; {
          isCancelled = true;
        };
    }, [vCardNameOwner, vCardNumber, vCardExpirationMonth, vCardExpirationYears, vCardCVV]);
  </code></pre>
  <p>that code makes my app to crash because token isnt declared and i dont know how to re do the operation so it can work fine</p>
  <p>if i delete the useeffect thing and leave just the openpay function with hardcoded values everything work well but i need it to take the values that the user insert in the form</p>
  <pre><code> openpay.createCardToken({
      holder_name: vCardNameOwner,
      card_number: vCardNumber,
      expiration_month: vCardExpirationMonth,
      expiration_year: vCardExpirationYears,
      cvv2: vCardCVV,
    })
    .then((token) =&gt; setvTokenId(token), console.log( '/////generacion de token//////' ,token));
  </code></pre>
  <p>thanks a lot for your time</p>