[Bug]: TypeError: (0 , o.createContext) is not a function
Closed this issue · 1 comments
and-sm commented
Telegram Application
Other
Describe the Bug
I'm getting TypeError: (0 , o.createContext) is not a function
when trying to use SDKProvider context.
To Reproduce
Steps to reproduce the behavior:
- Create Next.js app using
npx create-next-app@latest
- Install tma.js:
npm i @tma.js/sdk @tma.js/sdk-react
- Add SDKProvider to root layout.tsx:
import {SDKProvider} from "@tma.js/sdk-react";
...
<SDKProvider>
<html lang="en">
<body className={inter.className}>{children}</body>
</html>
</SDKProvider>
- Run
npm run build
Expected Behavior
Build success.
heyqbnk commented
You should not use SDKProvider
in the layout component. Please, refer to the Next.js template.