Skip to content

Proper way to use next/link with flowbite-react #592

Closed Answered by tulup-conner
upview asked this question in Q&A
Discussion options

You must be logged in to vote

We haven't got this feature on every component, but you can cast many components to any generic component and pass its props.

For example, see https://github.com/themesberg/flowbite-react/blob/main/src/components/Sidebar/SidebarItem.tsx#L83. You can implement this as

import Link from "next/link";

<Sidebar.Item as={Link} href="/" prefetch={false}>Next.js Link</Sidebar.Item>

If you find a component that should have this but you can't, please do create an issue and we'll fix that up.

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@VladBrok
Comment options

Answer selected by tulup-conner
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants