npm i signature-component
yarn add signature-component
import { useActions, Signature } from 'signature-component';
const { clearSignature, getImageSignature, isEmpty, changeBackgroundColor } = useActions()
const imageIsEmpty = () => {
!isEmpty() ? console.log(getImageSignature()) : console.log("not image!")
}
return (
<div>
<div>
<button onClick={() => clearSignature()}>
Clear
</button>
<button onClick={imageIsEmpty}>
Get image
</button>
<button onClick={() => changeBackgroundColor("#87CEEB")}>
Background
</button>
</div>
<Signature
penColor="#000000"
width={500}
height={500}
/>
</div>
)