-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Expand file tree
/
Copy pathFeastUI.tsx
More file actions
39 lines (33 loc) · 1.25 KB
/
FeastUI.tsx
File metadata and controls
39 lines (33 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import React from "react";
import { BrowserRouter } from "react-router-dom";
import { QueryClient, QueryClientProvider } from "react-query";
import { QueryParamProvider } from "use-query-params";
import { ReactRouter6Adapter } from "use-query-params/adapters/react-router-6";
import FeastUISansProviders, { FeastUIConfigs } from "./FeastUISansProviders";
interface FeastUIProps {
reactQueryClient?: QueryClient;
feastUIConfigs?: FeastUIConfigs;
}
const defaultQueryClient = new QueryClient();
const FeastUI = ({ reactQueryClient, feastUIConfigs }: FeastUIProps) => {
const queryClient = reactQueryClient || defaultQueryClient;
const basename = process.env.PUBLIC_URL ?? "";
return (
// Disable v7_relativeSplatPath: custom tab routes don't currently work with it
<BrowserRouter
basename={basename}
future={{ v7_relativeSplatPath: false, v7_startTransition: true }}
>
<QueryClientProvider client={queryClient}>
<QueryParamProvider adapter={ReactRouter6Adapter}>
<FeastUISansProviders
basename={basename}
feastUIConfigs={feastUIConfigs}
/>
</QueryParamProvider>
</QueryClientProvider>
</BrowserRouter>
);
};
export default FeastUI;
export type { FeastUIConfigs };