AN
Size: a a a
AN
AN
AN
new URL(router.asPath);
не катитAN
Вт
shallow
property on next/link
or the shallow
option on Router.push
AN
AN
AN
Вт
Вт
AN
AN
emptyHandler={event => {
const url = new URL(window.location.href);
url.searchParams.delete('search');
const targetURL = url.href.replace(url.origin, '');
router.push(targetURL, null, { shallow: true });
}}
AN
AN
router.push(targetURL, { shallow: true });
Вт
AN
router.push(targetURL, targetURL, { shallow: true });
— c перезагрузкой страницыAN
window.history.pushState({ path: targetURL }, '', targetURL);
— work this way, but don’t cause rerenderAN
router.push(router.pathname, targetURL, { shallow: true });
Вт
AN