RedHatInsights/insights-rbac-ui

View on GitHub
src/hooks/useAppNavigate.js

Summary

Maintainability
A
0 mins
Test Coverage
import { useNavigate } from 'react-router-dom';
import { mergeToBasename } from '../presentational-components/shared/AppLink';

const useAppNavigate = (linkBasename) => {
  const navigate = useNavigate();

  return (to, options) => {
    return navigate(mergeToBasename(to, linkBasename), options);
  };
};

export default useAppNavigate;