Dva @ connect injects props into the component only after the value is undefined

problem description

use @ connect of dva to inject props into the component in antdpro, and the component takes the print this.props to see that the injected value is undefined;

the environmental background of the problems and what methods you have tried

component code
@ connect (({testData, loading}) = > ({
testData,
loading: loading.effects ["test/fetchTestData"],
}))

class Test extends React.Component {
state = {

data: []

}

componentDidMount () {

const { dispatch } = this.props;
  dispatch({
    type: "test/fetchTestData"
});

}

render () {

console.log(this.props)//Propsundefined
...

< hr >

models Code
import {queryTestData} from"@ / services/api";

export default {
namespace: "test",

state: {

testData:[]

},

effects: {

*fetchTestData({ payload }, { call, put }) {
  const response = yield call(queryTestData, payload);//fetch
  console.log(response)//mock
  yield put({
    type: "getData",
    payload: response,
  });
},

},

reducers: {

getData(state, { payload }) {
  
  console.log(state,payload) //
  return {
    ...state,
    ...payload,
  };
},

},
};


has been solved. When the structural data in @ connect comes out, the received parameters are divided by namespace:...,.
so change
@ connect (({testData, loading})) = > ({
testData,
loading: loading.effects ['test/fetchTestData'],
})
to
@ connect (({test, loading}) = > ({
test,
loading: loading.effects [' test/fetchTestData']
})

)
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e667e6-448dc.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e667e6-448dc.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?