telegram-jsx
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

Telegram JSX

TSX/JSX runtime for telegram bots

Installation

  1. Run:
    npm install telegram-jsx
  2. Set these properties in tsconfig.json
    {
      "jsx": "react-jsx",
      "jsxImportSource": "telegram-jsx",
      "include": ["node_modules/telegram-jsx/index.d.ts"]
    }

Usage

Now you can create components and use TSX

import { Paragraph } from "telegram-jsx";

export function Ul({ children }: { children: Iterable<JSX.Child> }) {
  return (
    <>
      {[...children].filter(Boolean).map((value) => (
        <Paragraph>
          <i></i> {value}
        </Paragraph>
      ))}
    </>
  );
}
telegram.updates.on("message", (context) =>
  context.reply((<b>yoo!</b>).toString())
);

Package Sidebar

Install

npm i telegram-jsx

Weekly Downloads

0

Version

1.1.0

License

Unlicense

Unpacked Size

36.2 kB

Total Files

18

Last publish

Collaborators

  • alexxandergrib