import React, { createContext, forwardRef, useContext } from 'react'; import { RoutesImperativeHandle, RoutesProviderInnerProps, RoutesWidgetProps, } from '@/hooks/Mapper/components/mapInterface/widgets/RoutesWidget/types.ts'; type MapProviderProps = { children: React.ReactNode; } & RoutesWidgetProps; const RoutesContext = createContext({ update: () => {}, // @ts-ignore data: {}, }); // INFO: this component have imperative handler but now it not using. export const RoutesProvider = forwardRef( ({ children, ...props } /*, ref*/) => { // useImperativeHandle(ref, () => ({})); return {children}; }, ); RoutesProvider.displayName = 'RoutesProvider'; export const useRouteProvider = () => { const context = useContext(RoutesContext); return context; };