Telegram-Mini-Apps / telegram-apps

Made from scratch TypeScript packages, examples and documentation you will surely need to start developing on Telegram Mini Apps.
https://docs.telegram-mini-apps.com/
MIT License
691 stars 191 forks source link

[Bug]: Module "@telegram-apps/sdk-react" has no exported member "SDKProvider". ts(2305) #524

Closed Pp-Tomo closed 3 weeks ago

Pp-Tomo commented 3 weeks ago

Telegram Application

Telegram for iOS, Telegram for macOS

Describe the Bug

package.json

"dependencies": { "@next/third-parties": "^15.0.1", "@nextui-org/react": "^2.4.1", "@nextui-org/theme": "2.2.4", "@tanstack/react-query": "^5.40.0", "@telegram-apps/sdk-react": "^2.0.9", "axios": "^1.7.2", "bignumber.js": "^9.1.2", "clsx": "^2.1.1", "framer-motion": "^11.1.1", "jotai": "^2.10.1", "moment": "^2.30.1", "next": "14.2.3", "next-themes": "^0.2.1", "react": "18.3.1", "react-copy-to-clipboard": "^5.1.0", "react-dom": "18.3.1", "react-photo-view": "^1.2.6", "sonner": "^1.5.0", "tailwindcss": "3.4.3", "vconsole": "^3.15.1" },

To Reproduce

import {  SDKProvider } from '@telegram-apps/sdk-react'
// ^ Module "@telegram-apps/sdk-react" has no exported member "SDKProvider". ts(2305)

Expected Behavior

Why?

heyqbnk commented 3 weeks ago

Because it has no SDKProvider. Read documentation

Pp-Tomo commented 3 weeks ago

Because it has no SDKProvider. Read documentation

@heyqbnk This is the case in the document. https://docs.telegram-mini-apps.com/packages/telegram-apps-sdk-react/1-x


import { SDKProvider } from '@telegram-apps/sdk-react';

/**
 * Root component for the whole project.
 */
export function Root() {
  return (
    <SDKProvider acceptCustomStyles debug>
      <div>My application!</div>
    </SDKProvider>
  );
}
heyqbnk commented 2 weeks ago

You are using another version

https://docs.telegram-mini-apps.com/packages/telegram-apps-sdk-react/2-x