【发布时间】:2019-07-10 04:49:44
【问题描述】:
我有一个使用 Modal 组件呈现的 Paypal 按钮。在不引发清理错误的情况下卸载 Paypal 按钮的正确方法是什么?
这是对话框的实现
<Drawer anchor="bottom" open={open} onClose={() => setStatus(false)}>
<section className={classes.innerDrawer}>
<h2 className={classes.innerDrawerTitle}>
{loading ? '' : 'Checkout'}
</h2>
<PaypalButton
...props
/>
</section>
</Drawer>
还有按钮
const Button = paypal.Button.driver('react', { React, ReactDOM });
return (
<Button
env={PAYPAL_ENV}
client={client}
payment={(data, actions) => payment(data, actions)}
onAuthorize={data => execute(data.payerID, data.paymentID)}
style={{
size: 'medium', // tiny, small, medium
color: 'blue', // orange, blue, silver
shape: 'rect', // pill, rect
}}
/>
);
我得到的错误信息:
未捕获的错误:窗口无响应 - 已清理
卸载成功时我没有收到此错误消息,这发生在我处理付款时。
链接:
【问题讨论】:
-
什么时候出现这个错误?
-
在
onClose活动期间。当我尝试关闭抽屉时,它会卸载贝宝按钮 -
我明白了。 Drawer 组件是你开发的吗?还是来自第三方库?
-
材质ui组件