Published 2022. 3. 15. 14:53
반응형
" encodeURIComponent"와 "decodeURIComponent" 사용
get으로 보낼때는 encodeURIComponent
"/search/lists?keyword=" + encodeURIComponent(inputKeyword);
qeurystring 가져올때는 decodeURIComponent
defaultInputValue={keyword ? decodeURIComponent(keyword) :''}
반응형
'Frontend > React & React.Native &Next.js' 카테고리의 다른 글
NextJS) next 시작하기 (0) | 2022.04.18 |
---|---|
copyright 표시 코드 (0) | 2022.04.07 |
ReactJS) 게시판 작성시 띄어쓰기 안될때 nl2br 적용 (0) | 2022.03.11 |
NextJS) 모바일웹(mobile) 접속시 리다이렉트(redirect) 2가지 방법 (0) | 2022.02.07 |
NextJs) 상세페이지 만들기 (0) | 2022.01.26 |