import {Link, LinkProps, useLocation} from 'react-router-dom';
import { ReactNode } from 'react';

interface LinkWithQueryProps extends LinkProps {
    // children: ReactNode;
    // to: string;
    state?:any
}

export const LinkWithQuery = ({ children, to, ...props }: LinkWithQueryProps) => {
    const { search } = useLocation();



    return (
        <Link to={to + search} {...props}>
            {children}
        </Link>
    );
};
