mirror of
https://github.com/sergeyyarkov/educt-client.git
synced 2026-10-11 18:29:15 +03:00
14 lines
389 B
TypeScript
14 lines
389 B
TypeScript
import React, { ReactNode } from 'react';
|
|
import { StoreContext } from '../contexts';
|
|
import RootStore from '../stores/RootStore';
|
|
|
|
let store: RootStore;
|
|
|
|
/**
|
|
* Root store provider
|
|
*/
|
|
export const RootStoreProvider = ({ children }: { children: ReactNode }) => {
|
|
const root = store ?? new RootStore();
|
|
return <StoreContext.Provider value={root}>{children}</StoreContext.Provider>;
|
|
};
|