rsnext/examples/active-class-name/pages/[slug].tsx
Max Proske 3a22c4c554
Convert active-class-name example to TypeScript (#37676)
The Contributing guidelines say TypeScript should be leveraged for new examples, so I thought I'd convert this example over. 

I also:
- Upgraded all dependencies
- Replaced the `prop-types` package with TypeScript types

## Documentation / Examples

- [X] Make sure the linting passes by running `pnpm lint`
- [X] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples)
2022-06-14 08:49:09 +00:00

14 lines
248 B
TypeScript

import { useRouter } from 'next/router'
import Nav from '../components/Nav'
const SlugPage = () => {
const { asPath } = useRouter()
return (
<>
<Nav />
<p>Hello, I'm the {asPath} page</p>
</>
)
}
export default SlugPage