sbycrosz / react-native-credit-card-input

Easy, cross-platform credit-card input for your React Native Project! Start accepting payment 💰 in your app today!
MIT License
1.46k stars 699 forks source link

how to set onChange func? #116

Closed Talkwondo closed 2 months ago

Talkwondo commented 6 years ago

Hi, I probably missed something. can someone explain how to handle on change prop? If i want to extract the number and the other fields to state object.

Thanks,

ningacoding commented 5 years ago

this should be a stackoverflow question, not a ticket, but i'll answer for help:

// inside render
<CreditCardInput onChange={this._onCreditCardChanged} />

// outside render(){...}
private _onCreditCardChanged = (result) => {
        console.log(result);
    };

look at the log when running app.