import { Link, LinkProps } from "@awsui/components-react"; import React from "react"; import { useHistory } from "react-router-dom"; interface Props extends LinkProps { location: { pathName: string; state?: { solutionOnly?: boolean; activeFilter?: string; activeTabId?: string; }; }; } const LinkComponentInternal: React.FC = ({ location, ...props }) => { const history = useHistory(); return ( { event.preventDefault(); event.stopPropagation(); history.push(location.pathName, location.state); }} {...props} > ); }; export const LinkComponent = React.memo(LinkComponentInternal);