UNPKG

@yandex/ui

Version:

Yandex UI components

16 lines (15 loc) 883 B
import { __read } from "tslib"; import React, { useState } from 'react'; import { usePreviousValue } from '@yandex-lego/components/usePreviousValue'; import { Button } from '@yandex-lego/components/Button/Button.bundle/desktop'; export var Default = function () { var _a = __read(useState(0), 2), count = _a[0], setCount = _a[1]; var prevCount = usePreviousValue(count); return (React.createElement(React.Fragment, null, "\u0422\u0435\u043A\u0443\u0449\u0435\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: ", count, ". \u00A0 \u041F\u0440\u0435\u0434\u044B\u0434\u0443\u0449\u0435\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: ", prevCount, ". \u00A0", React.createElement(Button, { view: "action", size: "m", onClick: function () { return setCount(function (prev) { return prev + 1; }); } }, "+"))); };