内容简介: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.
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网
本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
世界是平的(3.0版)
[美] 托马斯·弗里德曼 / 何帆、肖莹莹、郝正非 / 湖南科学技术出版社 / 2008-9 / 58.00元
世界变得平坦,是不是迫使我们跑得更快才能拥有一席之地? 在《世界是平的》中,托马斯·弗里德曼描述了当代世界发生的重大变化。科技和通信领域如闪电般迅速的进步,使全世界的人们可以空前地彼此接近——在印度和中国创造爆炸式增长的财富;挑战我们中的一些人,比他们更快占领地盘。3.0版新增两章,更新了报告和注释方面的内容,这些内容均采自作者考察世界各地特别是整个美国中心地带的见闻,在美国本土,世界的平坦......一起来看看 《世界是平的(3.0版)》 这本书的介绍吧!