skip to Main Content

Defining MainButton.onClick() for Telegram Webapp correcly – Telegram API

I am trying to define window.Telegram.WebApp.MainButton.onClick() functionality to use the most recent values. Lets see through code: // selectedRegions is an array of strings const [selectedRegions, setSelectedRegions] = React.useState([""]); React.useEffect(() => { window.Telegram?.WebApp.MainButton.onClick(() => { // window.Telegram.WebApp.sendData(selectedRegions); alert("main button clicked");…

VIEW QUESTION
Back To Top
Search