Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
Tags
- background-color 속성
- 아두이노
- css
- RGB
- Live Server
- focus 의사클래스
- height속성
- go live
- br 태그
- 자식결합자
- RGBA
- iframe 태그
- 임베디드
- 전체 선택자
- width속성
- not 의사클래스
- tag html
- Checked 의사 클래스
- reveal in file explorer
- iframe
- i 태그
- 일반 형제 결합자
- html
- id 선택자
- sup태그
- 인접 형제 결합자
- sub태그
- padding 속성
- html 태그
- html tag i
Archives
- Today
- Total
so woon!
[REACT] useMatch() 사용하기 본문
학습일 : 2023. 04. 08
이번에는 useMatch hook에 대해 알아보자
useMatch() 는 내가 특정한 URL에 있는지의 여부를 알려준다.
사용해보기 위해서 먼저
Coin.tsx
작성 후
const priceMatch = useMatch("/:coinId/price");
const chartMatch = useMatch("/:coinId/chart");
console.log(priceMatch); 도 작성 해주고
console.log(priceMatch);
가격 탭을 누른 후 개발자 도구를 확인해보면
해당 URL에 들어가 있으니 이처럼 object를 받게 된다.
'ReactJS > 개념정리' 카테고리의 다른 글
[REACT] React Hook Form (0) | 2023.04.16 |
---|---|
[REACT] isActive 사용하기 (0) | 2023.04.08 |
[REACT] 중첩 라우팅 (Nested Routing) (0) | 2023.04.08 |
[REACT] state 유무에 따라 title 이 표시되는 방식 변경 (0) | 2023.04.08 |
[REACT] Data Types (0) | 2023.04.06 |
Comments