I would like to use a singleton in several different component contexts.
I want to use the singleton function in different components. However, it cannot be used because the SingletonObject type is not exported.
Is it possible to modify it?
-- translated by google
서로 다른 컴포넌트에서 singleton 기능을 사용 하고 싶습니다. 하지만 SingletonObject 타입이 export 되어 있지 않아 사용 할 수 없습니다.
수정이 가능합니까?
i would also like to see/use the SingletonObject type. how else am i supposed to pass the SingletonObject around. for now, i see the type is simple enough to just make my own that matches what i found here:
https://github.com/atomiks/tippyjs-react/blob/master/index.d.ts#L37
type SingletonObject = {
data?: any;
hook(args: SingletonHookArgs): void;
};
Since TippyProps is exported, and it contains a singleton type, you can access SingletonObject through that:
import Tippy, { TippyProps } from '@tippyjs/react'
interface Props {
tippySingleton: TippyProps['singleton']
}
But I agree that SingletonObject should probably be exported by itself.