Next.js & styled-components All In One
styled-components
$ npm i -S styled-components
$ yarn add styled-components
https://styled-components.com/
https://github.com/styled-components
https://github.com/styled-components/babel-plugin-styled-components
demos
https://nextjs.org/docs/api-reference/next/link#if-the-route-has-dynamic-segments
import Link from 'next/link'
import styled from 'styled-components'
// This creates a custom component that wraps an <a> tag
const RedLink = styled.a`
color: red;
`
function NavLink({ href, name }) {
return (
<Link href={href} passHref legacyBehavior>
<RedLink>{name}</RedLink>
</Link>
)
}
export default NavLink