i work on (dvajs+umijs+reactjs) project ,issue in this project is dva model state not saw in my function props or redux devtools, All required or related file below .
src/pages/Model/HomeData.js
export default {
namespace: 'Todo',
state: {
Todo:"Todo data",
id:"112334"
}
};
src/pages/Home/Home.js
import { connect } from 'dva'
import React from 'react'
function Home(props) {
console.log(props);
return (
<div>
Home
</div>
)
}
const mapStateToProps = (state) => {
return {
state:state
}
}
export default connect(mapStateToProps)(Home)
.umirc.js
import routeConfig from "./config/routeConfig";
export default {
treeShaking: true,
routes: routeConfig,
plugins: [
['umi-plugin-react', {
antd: true,
dva: {
immer: true
},
dynamicImport: true,
title: 'umi demo',
dll: false,
routes: {
exclude: [
/components\//,
],
},
}],
],
}
and project dependencies is
"dependencies": {
"dva": "^2.4.1",
"react": "^16.8.6",
"react-dom": "^16.8.6"
},
in redux devtools it saw me like this @@dva:0 not saw any namespace
state:
@@dva: 0
loading: {global: false, models: {…}, effects: {…}}
routing: {location: {…}}
[[Prototype]]: Object
staticContext: undefined
[[Prototype]]: Object
any idia how to solve or what is the problem in my code ?