UNPKG

@yandex/ui

Version:

Yandex UI components

15 lines (14 loc) 769 B
import { __read } from "tslib"; import React, { useState } from 'react'; import { useUpdateEffect } from '@yandex-lego/components/useUpdateEffect'; import { Button } from '@yandex-lego/components/Button/Button.bundle/desktop'; import { Text } from '@yandex-lego/components/Text/Text.bundle/desktop'; export var Default = function () { var _a = __read(useState(0), 2), count = _a[0], setCount = _a[1]; useUpdateEffect(function () { return alert(count); }, [count]); return (React.createElement(React.Fragment, null, React.createElement(Text, null, count, " \u00A0"), React.createElement(Button, { view: "action", size: "m", onClick: function () { return setCount(function (prev) { return prev + 1; }); } }, "+"))); };