这是我的代码,我想要在 sweetalert 模式中渲染
CarReport
组件。 <CarReport />
只是一个简单的形式。
Swal.fire({
title: "..."
html: <CarReport />, //How to write this line?
confirmButtonText: "Check",
preConfirm: () => {
//api request
},
});
当前此代码打开模式,但在模式主体中显示 [object object]。
sweetAlet 不支持 React 组件,因为它需要使用