@uiw/react-amap-utils
Advanced tools
Comparing version 5.0.8 to 5.0.9
@@ -150,4 +150,3 @@ "use strict"; | ||
}; | ||
// eslint-disable-next-line react-hooks/exhaustive-deps | ||
}, [instance, props[eventName]]); | ||
}, [instance, eventHandle]); | ||
}); | ||
@@ -175,4 +174,4 @@ } | ||
var vName = "".concat(name.charAt(0).toLowerCase()).concat(name.slice(1)); | ||
// eslint-disable-next-line react-hooks/rules-of-hooks | ||
var _useState5 = (0, _react.useState)(props[vName]), | ||
var eventHandle = props[vName]; | ||
var _useState5 = (0, _react.useState)(eventHandle), | ||
_useState6 = (0, _slicedToArray2["default"])(_useState5, 2), | ||
@@ -183,11 +182,10 @@ state = _useState6[0], | ||
(0, _react.useEffect)(function () { | ||
if (instance && props[vName] !== undefined) { | ||
if (props[vName] !== state && instance[eName] && typeof instance[eName] === 'function') { | ||
instance[eName](props[vName]); | ||
setState(props[vName]); | ||
if (instance && eventHandle !== undefined) { | ||
if (eventHandle !== state && instance[eName] && typeof instance[eName] === 'function') { | ||
instance[eName](eventHandle); | ||
setState(eventHandle); | ||
} | ||
} | ||
// eslint-disable-next-line react-hooks/exhaustive-deps | ||
}, [instance, props[vName]]); | ||
}, [instance, eventHandle]); | ||
}); | ||
} |
@@ -122,4 +122,3 @@ import _extends from "@babel/runtime/helpers/extends"; | ||
}; | ||
// eslint-disable-next-line react-hooks/exhaustive-deps | ||
}, [instance, props[eventName]]); | ||
}, [instance, eventHandle]); | ||
}); | ||
@@ -153,15 +152,14 @@ } | ||
var vName = "" + name.charAt(0).toLowerCase() + name.slice(1); | ||
var eventHandle = props[vName]; | ||
var [state, setState] = useState(eventHandle); | ||
// eslint-disable-next-line react-hooks/rules-of-hooks | ||
var [state, setState] = useState(props[vName]); | ||
// eslint-disable-next-line react-hooks/rules-of-hooks | ||
useEffect(() => { | ||
if (instance && props[vName] !== undefined) { | ||
if (props[vName] !== state && instance[eName] && typeof instance[eName] === 'function') { | ||
instance[eName](props[vName]); | ||
setState(props[vName]); | ||
if (instance && eventHandle !== undefined) { | ||
if (eventHandle !== state && instance[eName] && typeof instance[eName] === 'function') { | ||
instance[eName](eventHandle); | ||
setState(eventHandle); | ||
} | ||
} | ||
// eslint-disable-next-line react-hooks/exhaustive-deps | ||
}, [instance, props[vName]]); | ||
}, [instance, eventHandle]); | ||
}); | ||
} |
{ | ||
"name": "@uiw/react-amap-utils", | ||
"version": "5.0.8", | ||
"version": "5.0.9", | ||
"description": "基于 React 封装的高德地图组件。AMap Component Based On React.", | ||
@@ -36,4 +36,4 @@ "homepage": "https://uiwjs.github.io/react-amap", | ||
"dependencies": { | ||
"@uiw/react-amap-types": "5.0.8" | ||
"@uiw/react-amap-types": "5.0.9" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
25472
752
+ Added@uiw/react-amap-types@5.0.9(transitive)
- Removed@uiw/react-amap-types@5.0.8(transitive)
Updated@uiw/react-amap-types@5.0.9