Closed GarimaMathur07 closed 2 months ago
<CreditCardInput
ref={(c) => this.CCInput = c} -----> include
autoFocus
requiresName
requiresCVC
requiresPostalCode
labelStyle={s.label}
inputStyle={s.input}
validColor={"black"}
invalidColor={"red"}
cvc={'123'}
placeholderColor={"darkgray"}
onFocus={this._onFocus}
onChange={this._onChange} />
use this _post = () =>{ this.CCInput.setValues({ number: "4242" }); }
const refContainer = useRef(null);
<CreditCardInput ref = {refContainer} />
let startScan = async() =>{ refContainer.current.setValues({ number: "4242424242" }); }
@sbycrosz Set values into credit card form:
When i use credit card input library in my project and i have to set card values after card scan then this.refs object is empty from this line:
this.refs.CCInput.setValues({ number: "4242" });
So, how can i set values after card scanning.