react 的model.confirm报错,它意味着你在使用动态主题(Dynamic Theme)时不能在静态函数中使用上下文,需要使用contextHolder
const [modal, contextHolder] = Modal.useModal(); React.useEffect(() => { modal.confirm({ // ... }); }, []); return <div>{contextHolder}</div>;
- component function Warning consume contextcomponent function warning consume contexts warning oldest active predicate consumer function supplier composable component context react mkdir directory function warning 函数predicate function consumer component following the function non-element directives component function handlechange component function react components function cannot string