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
702 stars 197 forks source link

[Bug]: useInitDataRaw return object instead Raw Data #458

Closed belov38 closed 2 months ago

belov38 commented 2 months ago

Telegram Application

Telegram for iOS, Telegram Desktop, Other

Describe the Bug

useInitDataRaw() return object instead raw data

To Reproduce

import { useInitDataRaw } from '@telegram-apps/sdk-react';
...
const initDataRaw = useInitDataRaw ()

Expected Behavior

expect initDataRaw is string, but got Object

heyqbnk commented 2 months ago

Yes, that's right. I assume, its name may be misleading. To get the result you expect, consider using such code:

useLaunchParams().initDataRaw