Socket
Book a DemoInstallSign in
Socket

@twa-dev/backbutton

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@twa-dev/backbutton

React component for Telegram Web Apps (TWA) Back Button

latest
Source
npmnpm
Version
0.0.7
Version published
Maintainers
1
Created
Source

DEPRECATED

BackButton moved to @twa-dev/sdk. This repo and corresponding npm-package are deprecated.

BackButton

npm version

React component for Telegram Web Apps (TWA) Back Button.

npm i @twa-dev/backbutton

Motivation

TWA SDK contains an interface that controls BackButton. It's written in imperative way:

const BackButton = window.Telegram.WebApp.BackButton;

BackButton.show();
BackButton.onClick(() => window.history.back());

It's not the best way to write code, especially if you use libraries like React.

This package exports React component that wraps TWA BackButton SDK:

import BackButton from '@twa-dev/backbutton';

<BackButton onClick={() => window.history.back()} />

Demo

@BackButtonDemoBot

Codesandbox

Keywords

telegram

FAQs

Package last updated on 12 Sep 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.