mirror of
https://github.com/lockin-bot/react-telegram.git
synced 2026-01-12 22:27:38 +08:00
- Split project into three packages:
- @react-telegram/core: Core React reconciler
- @react-telegram/mtcute-adapter: MTCute Telegram adapter
- @react-telegram/examples: Example bots (private)
- Add <br /> tag support for line breaks
- Update all examples to use <br /> instead of {'\n'}
- Configure Bun workspaces for better package management
- Update imports to use package names instead of relative paths
- Update README with new installation instructions
- Remove test files (moved to separate testing setup)
BREAKING CHANGE: Package names changed from react-telegram to @react-telegram/*
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
@react-telegram/core
Core React reconciler for building Telegram bots with React components.
Installation
bun add @react-telegram/core react
Usage
import { createContainer } from '@react-telegram/core';
const { render, container } = createContainer();
const App = () => (
<>
<b>Hello Telegram!</b>
<br />
<i>Built with React</i>
</>
);
render(<App />);
console.log(container.root);
Supported Elements
Text Formatting
<b>,<strong>- Bold text<i>,<em>- Italic text<u>,<ins>- Underlined text<s>,<strike>,<del>- Strikethrough text<code>- Inline code<pre>- Code blocks<br />- Line breaks
Telegram-specific
<tg-spoiler>- Spoiler text<tg-emoji>- Custom emoji<blockquote>- Quotes (with optionalexpandableprop)<a>- Links
Interactive Elements
<button>- Inline keyboard buttons<row>- Button row container<input>- Text input handler
TypeScript Support
This package includes full TypeScript definitions. The JSX elements are automatically typed when you import the package.
License
MIT