【发布时间】:2019-07-09 08:12:28
【问题描述】:
我想像这样在 Sweet Alert 中编写 JSX:
class TodoApp extends React.Component {
componentDidMount() {
swal({
html: <Welcome />
});
};
render() {
return <Welcome />;
}
}
const Welcome = (props) => <p>Welcome to Sweet Alert and React</p>;
ReactDOM.render(<TodoApp />, document.querySelector("#app"))
但我收到Uncaught TypeError: t.html.cloneNode is not a function 错误。
如何在 Sweet Alert html 中编写 JSX?
【问题讨论】:
-
重写 Sweet Alert 中处理该数据的部分
-
@Quentin 但是如何?
标签: javascript reactjs jsx sweetalert2