hey folks,
Instead of lifting state up, I’m trying to create an Uppy Context which I can share with other components, and since @uppy/core
does not have a exported type for Uppy, how do I define the type in context?
what I’ve tried so far,
const UppyContext = createContext<null| typeof Uppy>(null);
const UppyContext = createContext<null| typeof Uppy<Meta, Body>(null); //I have imported them from core and used directly,
the type of Uppy when initialised directly is Uppy<Meta, Record<string, never>>
and when I try to plug it in directly, it still is not working out.
and one last thing, is it recommended to instead use useMemo
to memoize the uppy instead?