button with nextlink wrapping as component

pull/116/head
Tim Pechersky 2021-08-18 14:40:56 +02:00
rodzic ec2e780ba9
commit ed36f6d5b0
1 zmienionych plików z 17 dodań i 0 usunięć

Wyświetl plik

@ -0,0 +1,17 @@
import React from "react";
import { chakra, Button, Link } from "@chakra-ui/react";
import NextLink from "next/link";
const _RouteButton = (props) => {
return (
<NextLink href={props.href} passHref>
<Button as={Link} {...props}>
{props.children}
</Button>
</NextLink>
);
};
const RouteButton = chakra(_RouteButton, "button");
export default RouteButton;