Skip to content

Category: Questions

Why url query component is not removed?

I wrap the href to URL, and try to remove one component, remove with delete, but component does not disappear. Do you know why? let url = new URL(window.location.href); let p = url.searchParams[‘…

More elegant way of checking all state values

Is there a more elegant way of checking all state variables in my react app ? I currently have 14 state variables within my app, I am checking the value of each and updating to an empty string if they do not pass validation (left empty) code is as: This does work, so its not the end of the world,