@datalayer/core
Version:
**Datalayer Core**
18 lines (17 loc) • 574 B
JavaScript
import { jsx as _jsx } from "react/jsx-runtime";
/*
* Copyright (c) 2023-2025 Datalayer, Inc.
* Distributed under the terms of the Modified BSD License.
*/
import { forwardRef, useCallback } from 'react';
import { useNavigate } from '../../hooks';
/**
* React router Link for primer NavList
*/
export const NavLink = forwardRef(({ to, children, ...props }, ref) => {
const navigate = useNavigate();
const onClick = useCallback(() => {
navigate(to);
}, [to]);
return (_jsx("a", { ref: ref, ...props, onClick: onClick, children: children }));
});