본문 바로가기
React

react에서 리랜더링 없이 url에 쿼리 수정하기

by jennyiscoding 2024. 8. 1.
	const handlePagination = page => {
		setCurrentPage(page.selected)
		const currentUrlParams = new URLSearchParams(window.location.search)
		currentUrlParams.set('currentPage', page.selected)
		window.history.replaceState(null, '', `?${currentUrlParams.toString()}`)
	}

'React' 카테고리의 다른 글

moment로 날짜 나타내기  (0) 2024.06.28
/* eslint-disable @typescript-eslint/no-use-before-define */  (0) 2023.10.04
confirm 사용방법  (0) 2023.01.30
Link to, history를 사용하기  (0) 2022.12.04
메타테그란?  (0) 2022.11.15