Using Redux in React I'm having a warning that the default parameters should be last default-param-last. on the line where I created the const warehouse. is there wrong on how I created the code? or is there a better code for that?
Here's my codes
import {SAVE_ACTION} from '../actions/save-action';
cons initialState = {
datasToSave:[]
};
const warehouse = (state = initialState, {type, payload}) => {
switch(type) {
case SAVE_ACTION: {
const {datasToSave} = payload
return {
...state,
dataToSave
};
}
default:
return state;
}
};
export default warehouse;