mirror of
https://github.com/penpot/penpot-exporter-figma-plugin.git
synced 2024-12-22 13:43:03 -05:00
4b711b3526
* Refactor context * fix * fix
14 lines
481 B
TypeScript
14 lines
481 B
TypeScript
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 };
|