I'm going through and adding a feature to code that exists and learning it at the same time, so heads up if I'm missing something big.
So I have this function:
export const LoadGrid = () => {
return dispatch => {
something.GetData(agasdg, {
'parameters',
})
.then(r => r.json())
.then(json => {
console.log(json);
const parts = json.Rows.map(part => {
return {
// Keys and stuff
};
});
dispatch({
type: Types.InventoryLocationMove.LOAD_GRID,
payload: parts,
});
})
.catch(err => console.log(err));
};
};
and then in another part of my program I have this to call it:
<Button
style={style}
onPress={
({ GridData } = () => {
return LoadGrid({ location });
})
}
>
But it just gives GridData a null value and errors my app.
I know I'm missing some basic concept, and there's a lot more code but I can't exactly post it all here.
Thanks!