0
Fork 0
mirror of https://github.com/penpot/penpot-exporter-figma-plugin.git synced 2024-12-23 06:04:01 -05:00
penpot-exporter-figma-plugin/ui-src/context/FigmaContext.tsx

15 lines
481 B
TypeScript
Raw Normal View History

import { JSX, PropsWithChildren } from 'react';
import { createGenericContext } from './createGenericContext';
import { UseFigmaHook, useFigma } from './useFigma';
const [useFigmaContext, StateContextProvider] = createGenericContext<UseFigmaHook>();
const FigmaProvider = ({ children }: PropsWithChildren): JSX.Element => {
const hook = useFigma();
return <StateContextProvider value={hook}>{children}</StateContextProvider>;
};
export { FigmaProvider, useFigmaContext };