Reactjs 我的Redux状态正在改变,但它没有改变;重新渲染

Reactjs 我的Redux状态正在改变,但它没有改变;重新渲染,reactjs,redux,react-redux,redux-thunk,Reactjs,Redux,React Redux,Redux Thunk,我有一个父组件和一个子组件。我可以看到reducer正在更新(请参阅屏幕截图),但它没有重新渲染组件。我正在调用一些API,一旦响应出现,它将只更新一些变量并重新呈现组件 父组件 import React,{Component}来自'React'; 从“反应选项卡”导入{Tab,Tabs,TabList,TabPanel}; 从“react redux”导入{connect}; 从“redux”导入{bindActionCreators} 从“../components/Profile/Pro

我有一个父组件和一个子组件。我可以看到reducer正在更新(请参阅屏幕截图),但它没有重新渲染组件。我正在调用一些API,一旦响应出现,它将只更新一些变量并重新呈现组件

父组件

import React,{Component}来自'React';
从“反应选项卡”导入{Tab,Tabs,TabList,TabPanel};
从“react redux”导入{connect};
从“redux”导入{bindActionCreators}
从“../components/Profile/ProfileInfo”导入ProfileInfo
从“../components/Profile/Details”导入详细信息
从“../components/Profile/UnitSpec”导入UnitSpec
从“/./actions/profileActions”导入*作为profileActionCreators;
将*作为静态数据从“../utils/country”导入
类NewProfilePage扩展组件{
建造师(道具){
超级(道具);
this.state={tabIndex:0,
countryList:StaticData.Country,
};
让{dispatch}=this.props
this.actions=bindActionCreators({…profileActionCreators},dispatch);
}
组件将接收道具(下一步){
log('nextrops',nextrops)
}
render(){
返回(
this.setState({tabIndex})}>
细节
单位规格
幻想
菜单
this.actions.updateDetails(userDetail)}countryList={this.state.countryList}/>
);
}
}
常量mapStateToProps=(状态)=>{
console.log('state',state)
返回{
profileReducer:state.profileReducer
};
};

导出默认连接(mapStateToProps)(NewProfilePage)您的状态包含配置文件

const mapStateToProps= (state) => {
    console.log('state', state)
    return{
         profileReducer: state.profile
    };
};

正如答案所暗示的,通常最好也包括你的店铺设置;您可能没有使用对象速记。您还可以在
mapStateToProps
中放置日志或断点,作为健全性检查。