I found https://stackoverflow.com/a/73353425/21065649 which basically uses useSearchParams
from react-router-dom
to remove query string parameters.
However, in my case, I'm using an array of keys and I have to loop over them to remove params.
The problem is case sensitivity.
const [searchParams, setSearchParams] = useSearchParams();
const keys = ['Title', 'State']
for (let index in keys) {
if (searchParams.has(keys[index]) { // I want this to be case-insensitive
seearchParams.delete(keys[index])
}
}
I don't know how to do that.