react-native-signature-canvas 4.3.1 → 4.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/index.d.ts +1 -1
  2. package/index.js +6 -1
  3. package/package.json +3 -6
package/index.d.ts CHANGED
@@ -31,7 +31,7 @@ declare module "react-native-signature-canvas" {
31
31
  onRedo?: () => void;
32
32
  onDraw?: () => void;
33
33
  onErase?: () => void;
34
- onGetData?: () => void;
34
+ onGetData?: (data: any) => void;
35
35
  onChangePenColor?: () => void;
36
36
  onChangePenSize?: () => void;
37
37
  onBegin?: () => void;
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import React, { useState, useMemo, useRef, forwardRef, useImperativeHandle } from "react";
1
+ import React, { useState, useEffect, useMemo, useRef, forwardRef, useImperativeHandle } from "react";
2
2
  import { View, StyleSheet, ActivityIndicator } from "react-native";
3
3
 
4
4
  import htmlContent from "./h5/html";
@@ -86,6 +86,11 @@ const SignatureView = forwardRef(({
86
86
  return { html };
87
87
  }, [customHtml, autoClear, trimWhitespace, rotated, imageType, webStyle, descriptionText, confirmText, clearText, dataURL, bgSrc, bgWidth, bgHeight])
88
88
 
89
+ useEffect(()=> {
90
+ if(webViewRef.current) {
91
+ webViewRef.current.reload();
92
+ } }, [source]);
93
+
89
94
  const isJson = (str)=> {
90
95
  try {
91
96
  JSON.parse(str);
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "react-native-signature-canvas",
3
- "version": "4.3.1",
3
+ "version": "4.4.0",
4
4
  "description": "React Native Signature Component based Canvas for Android && IOS && expo",
5
5
  "main": "index.js",
6
6
  "scripts": {
7
- "build": "npm publish",
7
+ "publish": "npm publish",
8
8
  "genlog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0",
9
9
  "postversion": "git push --follow-tags"
10
10
  },
@@ -28,10 +28,7 @@
28
28
  "url": "https://github.com/YanYuanFE/react-native-signature-canvas/issues"
29
29
  },
30
30
  "homepage": "https://github.com/YanYuanFE/react-native-signature-canvas#readme",
31
- "devDependencies": {
32
- "react-native-webview": "^11.17.0"
33
- },
34
31
  "peerDependencies": {
35
- "react-native-webview": "11"
32
+ "react-native-webview": ">=11.22.1"
36
33
  }
37
34
  }