티스토리 뷰
Styles JSX
import Link from "next/link";
import { useRouter } from "next/router";
export default function NavBar() {
const router = useRouter();
return (
<nav>
<Link href="/">
<a className={router.pathname === "/" ? "active" : ""}>Home</a>
</Link>
<Link href="/about">
<a className={router.pathname === "/about" ? "active" : ""}>About</a>
</Link>
<style jsx>{`
a {
text-decoration: none;
}
.active {
color: ${props.color} | red;
}
`}</style>
</nav>
);
}'NextJS' 카테고리의 다른 글
| [NextJS] Redirect and Rewrite (0) | 2022.10.14 |
|---|---|
| [NextJS] _app (0) | 2022.10.14 |
| [NextJS] CSS Modules (0) | 2022.10.14 |
| [NextJS] Routing (0) | 2022.10.14 |
| [NextJS] Pages / Static Pre Rendering (0) | 2022.10.14 |
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- mediaprint
- nextredirect
- React
- Socket
- cssmodules
- websocekt
- firebasev9
- nextjsseo
- Router
- 웹인쇄
- NextJS
- firebasecollection
- reduxtoolkit
- nextjsrouter
- nextjsjsx
- webhook이란
- typescriptclass
- typescriptfunction
- firebaseorderby
- stylesjsx
- nextjscss
- typescriptinterface
- serversiderendering
- 파이어베이스버전9
- reactquill
- 404pages
- 웹소캣
- nextrewrite
- reactjs
- TypeScript
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 |
글 보관함
