bigbuffet-rw/packages/pl-fe/src/init/pl-fe.tsx

44 lines
1.2 KiB
TypeScript
Raw Normal View History

2022-08-01 18:13:02 -07:00
import { QueryClientProvider } from '@tanstack/react-query';
2023-10-07 16:39:37 -07:00
import React from 'react';
import { HelmetProvider } from 'react-helmet-async';
2022-04-21 10:19:33 -07:00
import { Provider } from 'react-redux';
import { StatProvider } from 'pl-fe/contexts/stat-context';
import { createGlobals } from 'pl-fe/globals';
import { queryClient } from 'pl-fe/queries/client';
import { checkOnboardingStatus } from '../actions/onboarding';
import { preload } from '../actions/preload';
import { store } from '../store';
2020-03-27 13:59:38 -07:00
import PlFeHead from './pl-fe-head';
import PlFeLoad from './pl-fe-load';
import PlFeMount from './pl-fe-mount';
2023-10-07 16:37:19 -07:00
// Configure global functions for developers
createGlobals(store);
// Preload happens synchronously
store.dispatch(preload() as any);
// This happens synchronously
store.dispatch(checkOnboardingStatus() as any);
2022-05-20 10:30:29 -07:00
/** The root React node of the application. */
const PlFe: React.FC = () => (
<Provider store={store}>
<QueryClientProvider client={queryClient}>
<StatProvider>
<HelmetProvider>
<PlFeHead />
<PlFeLoad>
<PlFeMount />
</PlFeLoad>
</HelmetProvider>
</StatProvider>
</QueryClientProvider>
</Provider>
);
2020-03-27 13:59:38 -07:00
export { PlFe as default };