内容简介:app.js 注入modalReducer`export const dva = {config: {
app.js 注入modalReducer
`export const dva = {
config: {
extraReducers: {
modal: modalReducer,
},
onError(e) {
e.preventDefault();
if (sentry) {
console.log('sentry', e.message);
}
},
// 注释以下可关闭logger
// onAction: createLogger(loggerConfig),
},
};`
modal.jsx
`import React from 'react';
import { connect } from 'dva';
import { connectModal } from 'redux-modal';
import { Modal } from 'antd';
function FollowUp(props:any) {
console.log(props);
function cancel (){
props.handleHide()
}
return (
<Modal
title="实战"
visible={true}
onCancel={() => {}}
<div>hello world</div>
) }
// export default connect((state:any) => state)(FollowUp);
export default connectModal({
name: 'follow-up',
destroyOnHide: true,
})(FollowUp);
`
ErrorBoundary.jsx
return ( <> {this.props.children} <Modals/> </> )
报告错误:
Error: Could not find "store" in the context of "Connect(ConnectModal(FollowUp))". Either wrap the root component in a , or pass a custom React context provider to and the corresponding React context consumer to Connect(ConnectModal(FollowUp)) in connect options.
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网
猜你喜欢:- 开发者在 GitHub fork 的私有项目,现在却无法访问了……
- Xcode10.2无法将项目运行到iOS10以下的模拟器上
- android – 无法将cordova-plugin-uid添加到Visual Studio 2013项目中
- Windows 10 解决无法完整下载安装语言包(日语输入法无法下载使用)
- ruby-on-rails – 无法推送到github,ssh:无法解析主机名
- erlang节点无法连接问题?
本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
特别版MATHEMATICA全书
[美] 斯蒂芬·沃尔夫雷 / 赫孝良、周义仓 / 西安交通大学出版社 / 2002-1 / 60.00元
一起来看看 《特别版MATHEMATICA全书》 这本书的介绍吧!