Question: Unable to dynamically set dataURL on any device
josh-thompson13 opened this issue · 0 comments
josh-thompson13 commented
Hi there! I am trying to set the dataURL to equal the base64 image just saved. But it renders a blank screen. Here is the code
const [signature, setSignature] = useState("");
const saveDrawpadImage = (img: string) => {
setSignature(img);
};
return (
<View style={styles.container}>
<SignatureScreen
onOK={saveDrawpadImage}
onEmpty={() => console.log("empty")}
descriptionText="Sign Here"
clearText="Clear"
confirmText="Save"
webStyle={`.m-signature-pad--footer
.button {
background-color: black;
color: #FFF;
}
.m-signature-pad
{
width: 100%;
height: 80%;
margin-left: 0px;
margin-top: 0px;
}`}
autoClear={true}
imageType={"image/jpeg"}
dataURL={signature ? signature : ""}
/>
</View>
);