Ich versuche, einen sehr einfachen Änderungszustand auf Redux mit einem onClick-Ereignis zu erreichen, das auf einer meiner Komponenten gespeichert ist, aber ich kann es nicht herausfinden. Ich habe meine Logik, Aktion und Container in redux alles eingerichtet.Wie ändern Sie einen booleschen Wert, der in Redux für eine onClick-Funktion gespeichert ist?
CONTAINER:
export const ReportTableContainer = connnect((state) =>({
isOpen: state.app['modal-status']['isOpen']
}),() =>({FetchPopupReport}))(ReportTable)
FUNKTION EIN COMPONENT:
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 DATEI:
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();
})
}
});
Ich will nur die .then()
auf true