问题描述
代码如下:
useEffect(()=>{
console.log("this works and returns promocode: ",props.promocode)
if(braintree_token)
{
var button = document.querySelector('#submit-button');
dropin.create({
authorization: braintree_token,container: '#dropin-container',paypal: {
flow: 'vault'
},card:{
cardholderName: {
required: true
},postal_code: true
}
},function (createErr,instance) {
console.log("this is not working and return blank :( : ",props.promocode)
console.log(createErr);
}
}
},[]);
在上面的代码中,props.promocode 在 useEffect 中起作用,但在 Braintree 函数中不起作用。 初始级别第一次优惠码是空白的,但是当我申请优惠码时,它在braintree功能中仍然是空白的。
此外,当我应用促销代码时,它在控制台中给我错误,我在 Braintree 中打印了该错误。
error: DropinError {name: "DropinError",message: "options.selector or options.container must reference an empty DOM node.",_braintreeWebError: undefined}
message: "options.selector or options.container must reference an empty DOM node."
name: "DropinError"
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)