0
私のコンポーネントの1つにonClickイベントが格納された状態で、Reduxで非常に単純な変更状態を実行しようとしていますが、わかりません。私は自分の論理、行動、そしてコンテナをすべて還元している。どのようにして、onClick関数のReduxに格納されているブール値を変更しますか?
CONTAINER:COMPONENT ON
export const ReportTableContainer = connnect((state) =>({
isOpen: state.app['modal-status']['isOpen']
}),() =>({FetchPopupReport}))(ReportTable)
がFUNCTION:
onCellSelect = ({idx, rowIdx}) => {
if(idx <= 2 && idx > 0){
//where I want to change the state from false to true
}else if(idx > 2){
console.log('passed')
}
}
REDUXのFILE:
export const logic = createLogic({
type: FetchRoiReport,
process({ getState, action, api}, dispatch, done) {
dispatch(ModalStatus({isOpen: false}))
dispatch(Loading({report: true}));
api.get(URL)
.then(obj => {
dispatch(Loading({isOpen: false}));
dispatch(FetchRoiReportSucceeded(obj))
dispatch(ModalStatus({isOpen: false}));
done();
}).catch(err => {
dispatch(Loading({isOpen: false}));
dispatch(ModalStatus({status: false}));
dispatch(FetchRoiReportFailed("ERROR"));
done();
})
}
});
私はちょうど私が思う.then()
が真