@uiw/react-amap-utils
Advanced tools
Comparing version 7.0.2 to 7.1.0
@@ -19,3 +19,3 @@ export * from './usePortal'; | ||
hide: () => void; | ||
}>(instance: T, visiable?: boolean): void; | ||
}>(instance: T, visible?: boolean): void; | ||
/** | ||
@@ -22,0 +22,0 @@ * 获取上一轮的 props 或 state |
@@ -78,4 +78,4 @@ "use strict"; | ||
*/ | ||
function useVisiable(instance, visiable) { | ||
var _useState3 = (0, _react.useState)(visiable), | ||
function useVisiable(instance, visible) { | ||
var _useState3 = (0, _react.useState)(visible), | ||
_useState4 = (0, _slicedToArray2["default"])(_useState3, 2), | ||
@@ -85,4 +85,4 @@ state = _useState4[0], | ||
(0, _react.useEffect)(function () { | ||
if (instance && visiable !== undefined) { | ||
if (visiable) { | ||
if (instance && visible !== undefined) { | ||
if (visible) { | ||
instance.show && instance.show(); | ||
@@ -92,8 +92,8 @@ } else { | ||
} | ||
if (visiable !== state) { | ||
setState(visiable); | ||
if (visible !== state) { | ||
setState(visible); | ||
} | ||
} | ||
// eslint-disable-next-line react-hooks/exhaustive-deps | ||
}, [instance, visiable]); | ||
}, [instance, visible]); | ||
} | ||
@@ -100,0 +100,0 @@ |
import { PropsWithChildren } from 'react'; | ||
export declare const usePortal: () => { | ||
Portal: ({ children }: PropsWithChildren) => import("react").ReactPortal; | ||
Portal: ({ children }: PropsWithChildren) => import("react").ReactPortal | null; | ||
container: HTMLDivElement; | ||
}; |
@@ -19,2 +19,3 @@ "use strict"; | ||
var children = _ref.children; | ||
if (!children) return null; | ||
return /*#__PURE__*/(0, _reactDom.createPortal)(children, container); | ||
@@ -21,0 +22,0 @@ }, [container]); |
@@ -19,3 +19,3 @@ export * from './usePortal'; | ||
hide: () => void; | ||
}>(instance: T, visiable?: boolean): void; | ||
}>(instance: T, visible?: boolean): void; | ||
/** | ||
@@ -22,0 +22,0 @@ * 获取上一轮的 props 或 state |
@@ -50,7 +50,7 @@ import _extends from "@babel/runtime/helpers/extends"; | ||
*/ | ||
export function useVisiable(instance, visiable) { | ||
var [state, setState] = useState(visiable); | ||
export function useVisiable(instance, visible) { | ||
var [state, setState] = useState(visible); | ||
useEffect(() => { | ||
if (instance && visiable !== undefined) { | ||
if (visiable) { | ||
if (instance && visible !== undefined) { | ||
if (visible) { | ||
instance.show && instance.show(); | ||
@@ -60,8 +60,8 @@ } else { | ||
} | ||
if (visiable !== state) { | ||
setState(visiable); | ||
if (visible !== state) { | ||
setState(visible); | ||
} | ||
} | ||
// eslint-disable-next-line react-hooks/exhaustive-deps | ||
}, [instance, visiable]); | ||
}, [instance, visible]); | ||
} | ||
@@ -68,0 +68,0 @@ |
import { PropsWithChildren } from 'react'; | ||
export declare const usePortal: () => { | ||
Portal: ({ children }: PropsWithChildren) => import("react").ReactPortal; | ||
Portal: ({ children }: PropsWithChildren) => import("react").ReactPortal | null; | ||
container: HTMLDivElement; | ||
}; |
@@ -9,2 +9,3 @@ import { useCallback, useState } from 'react'; | ||
} = _ref; | ||
if (!children) return null; | ||
return /*#__PURE__*/createPortal(children, container); | ||
@@ -11,0 +12,0 @@ }, [container]); |
{ | ||
"name": "@uiw/react-amap-utils", | ||
"version": "7.0.2", | ||
"version": "7.1.0", | ||
"description": "基于 React 封装的高德地图组件。AMap Component Based On React.", | ||
@@ -37,4 +37,4 @@ "funding": "https://jaywcjlove.github.io/#/sponsor", | ||
"dependencies": { | ||
"@uiw/react-amap-types": "7.0.2" | ||
"@uiw/react-amap-types": "7.1.0" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
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
23592
669
+ Added@uiw/react-amap-types@7.1.0(transitive)
- Removed@uiw/react-amap-types@7.0.2(transitive)
Updated@uiw/react-amap-types@7.1.0