以下のように記述することでURLからクエリパラメータを削除できます。
const url = new URL(window.location.href) // URLを取得
history.replaceState(null, '', url.pathname) // URLからクエリパラメータを削除
以下のように記述することでURLからクエリパラメータを削除できます。
const url = new URL(window.location.href) // URLを取得
history.replaceState(null, '', url.pathname) // URLからクエリパラメータを削除
Register as a new user and use Qiita more conveniently