Answer the question
In order to leave comments, you need to log in
Where is the error in the function?
There is an error inside the function, I can't figure out what it is
setFilter() {
const {router} = this.context;
const {location} = this.props;
const query = {...location.query};
if (query.sort_direction === 'desc') {
delete query.sort_direction;
} else {
query.sort_direction = 'desc';
}
router.push({...location, query, state: 'REPLACE'});
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question