Array destructoring in React.js

I have implemented a hook that returns an array with two elements like below.

export function useSearchParams() {
return [searchParams, setSearchParams];


I only need to access this setSearchParams element in my component.

 const [{},setSearchParams] = useSearchParams();

This throws an es-lint warning when I add {} for the first parameter. What is the best practice on this? If I only want to access the second parameter?


You can do something like this:

const [,setSearchParams] = useSearchParams();


let arr = [1,3];
let [,ans] = arr;