Warning: [antd: Modal] Static function can not consume context like dynamic theme. Please use 'App' component instead.
react 的model.confirm报错,它意味着你在使用动态主题(Dynamic Theme)时不能在静态函数中使用上下文,需要使用contextHolder
const [modal, contextHolder] = Modal.useModal(); React.useEffect(() => { modal.confirm({ // ... }); }, []); return <div>{contextHolder}</div>;