currently I’ve faced that such a destructuring notation
const {selectedSpectrums, fetchedSpectraData, fetchedSpectraIndex} = useSelector(state => state.testResultsTreeReducer, isEqual);
works wrong and it is better to use
const selectedSpectrums = useSelector(state => state.testResultsTreeReducer.selectedSpectrums, isEqual);
const fetchedSpectraData = useSelector(state => state.testResultsTreeReducer.fetchedSpectraData, isEqual);
const fetchedSpectraIndex = useSelector(state => state.testResultsTreeReducer.fetchedSpectraIndex, isEqual);
So, why this is wrong and how can I avoid so many similar lines and use destructuring with lodash’ isEqual?