You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tailchat/client/web/src/components/AppRouterApi.tsx

16 lines
434 B
TypeScript

import React from 'react';
import type { PropsWithChildren } from 'react';
import { useNavigate, NavigateFunction } from 'react-router';
export let navigate: NavigateFunction = () => {
throw new Error('route navigate not init');
};
export const AppRouterApi: React.FC<PropsWithChildren> = React.memo(() => {
const _navigate = useNavigate();
navigate = _navigate;
return null;
});
AppRouterApi.displayName = 'AppRouterApi';