calculate-two-digits
v2.3.9
Published
calculation of two digits number
Downloads
16
Readme
calcute-two-digits
calculation of two digits number
Install
npm install --save calcute-two-digits
Usage
import React, { Component } from "react";
import {
CalculateComponent,
Button,
ButtonProps,
useNumber,
} from "calcute-two-digits";
class Example extends Component {
render() {
const { decrease, increase, number } = useNumber();
const increaseBtn: ButtonProps = {
label: "Increase Number",
onClick: increase,
};
const decreaseBtn: ButtonProps = {
label: "Decrease Number",
onClick: decrease,
};
return (
<NumberProvider>
<CalculateComponent a={5} b={6} operation="add" />
<Button {...decreaseBtn} />
{number}
<Button {...increaseBtn} />
</NumberProvider>
);
}
}