TelegramPWA/src/components/test/TestSetContent.tsx
2025-06-04 20:41:58 +02:00

25 lines
635 B
TypeScript

import type { FC } from '../../lib/teact/teact';
import { useState } from '../../lib/teact/teact';
// 1. Make sure "First line" is rendered even if followed by a component with single text.
// 2. Make sure it then can be normally removed (target is preserved).
// 3. Make sure "Last line" is also rendered.
const Text: FC = () => {
return 'text component';
};
export function App() {
const [withFirstLine, setWithFirstLine] = useState(true);
return (
<div onClick={() => setWithFirstLine((current) => !current)}>
{withFirstLine && 'First line'}
<Text />
Last line
</div>
);
}
export default App;