npmtestpackricky
Version:
We are providing a button
29 lines (25 loc) • 719 B
JavaScript
import * as React from 'react';
import { useState } from 'react';
function Button({ children }) {
return (React.createElement("button", { style: {
color: "black",
background: "white",
borderRadius: "5px",
border: "solid 2px black",
padding: "10px 20px",
margin: "10px 20px",
cursor: "pointer",
fontSize: "1.2em",
} }, children));
}
function useCounter() {
const [count, setCount] = useState(0);
const increment = () => {
setCount(count + 1);
};
const decrement = () => {
setCount(count - 1);
};
return { count, increment, decrement };
}
export { Button, useCounter };