useNavigateToChildPath
#
DescriptionNavigate to a URL, that has the same prefix as the current URL (e.g. /api/users
-> /api/users/3
).
#
Usageimport { useNavigateToChildPath } from '@springtree/eva-suite-react-hooks';
const Example = () => { // Current path: /example const navigate = useNavigateToChildPath(42);
return ( <button onClick={navigate}> {"Click to navigate to URL '/example/42'"} </button> );};
export default Example;