diff --git a/src/kkiapay.tsx b/src/kkiapay.tsx index 5cea866..e6e98b8 100644 --- a/src/kkiapay.tsx +++ b/src/kkiapay.tsx @@ -57,11 +57,12 @@ const WIDGET_URI = 'https://widget-v3.kkiapay.me?'; export function KkiapayProvider({ children }: PropsWithChildren) { const [widgetOpened, isWidgetOpened] = useState(false); const [uri, setUri] = useState(WIDGET_URI); - const [callbacks, setCallbacks] = useState>({}); + const [callbacks] = useState>({}); const defaultEvent = useRef(() => {}); function registerCallback(name: ListenerEventName, cb: T) { - setCallbacks((callbacks) => ({ ...callbacks, [name]: cb })); + callbacks[name] = cb; + //setCallbacks((callbacks) => ({ ...callbacks, [name]: cb })); } const openKkiapayWidget = (config: IData) => {