Socket
Socket
Sign inDemoInstall

@uiw/react-amap-utils

Package Overview
Dependencies
Maintainers
2
Versions
101
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@uiw/react-amap-utils - npm Package Compare versions

Comparing version 7.0.2 to 7.1.0

2

cjs/index.d.ts

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc