mirror of https://github.com/msgbyte/tailchat
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.
16 lines
434 B
TypeScript
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';
|