Closed gsw85 closed 1 month ago
Telegram Desktop
The error is on DisplayGate: Attempted import error: 'DisplayGate' is not exported from '@tma.js/sdk-react' (imported as 'DisplayGate').
import { SDKProvider, DisplayGate } from "@tma.js/sdk-react"; function SDKProviderError({ error }) { return ( <div> Oops. Something went wrong. <blockquote> <code> {error instanceof Error ? error.message : JSON.stringify(error)} </code> </blockquote> </div> ); } function SDKProviderLoading() { return <div>SDK is loading.</div>; } function SDKInitialState() { return <div>Waiting for initialization to start.</div>; } export function TmaSDKLoader({ children }) { return ( <SDKProvider options={{ async: true, complete: true, }} > <DisplayGate error={SDKProviderError} loading={SDKProviderLoading} initial={SDKInitialState} > {children} </DisplayGate> </SDKProvider> ); }
Expect to run normall and get the telegram data from user
Hey. There is no such component as DisplayGate anymore. You can now see how it works in React and Next templates.
DisplayGate
Documentation will be released soon
Documentation related to this topic. Check this out! https://docs.telegram-mini-apps.com/packages/tma-js-sdk-react
Telegram Application
Telegram Desktop
Describe the Bug
The error is on DisplayGate: Attempted import error: 'DisplayGate' is not exported from '@tma.js/sdk-react' (imported as 'DisplayGate').
To Reproduce
Expected Behavior
Expect to run normall and get the telegram data from user