Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@uiw/react-amap-api-loader

Package Overview
Dependencies
Maintainers
1
Versions
103
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@uiw/react-amap-api-loader - npm Package Compare versions

Comparing version 2.6.2 to 2.7.0

2

cjs/index.d.ts

@@ -61,2 +61,3 @@ import React, { Component } from 'react';

};
private isMountedOk;
/**

@@ -69,2 +70,3 @@ * 全局可能存在多个 Loader 同时渲染, 但是只能由一个负责加载

componentDidMount(): void;
componentWillUnmount(): void;
render(): React.ReactNode;

@@ -71,0 +73,0 @@ private getScriptSrc;

23

cjs/index.js

@@ -62,2 +62,3 @@ "use strict";

_this = _super.call(this, props);
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "isMountedOk", false);
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "state", {

@@ -67,10 +68,14 @@ loaded: !!window.AMap

(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "handleError", function (error) {
_this.setState({
error: error
});
if (_this.isMountedOk) {
_this.setState({
error: error
});
}
});
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "finish", function () {
_this.setState({
loaded: true
});
if (_this.isMountedOk) {
_this.setState({
loaded: true
});
}
});

@@ -88,2 +93,3 @@

value: function componentDidMount() {
this.isMountedOk = true;
var callbackName = this.props.callbackName;

@@ -101,2 +107,7 @@

}, {
key: "componentWillUnmount",
value: function componentWillUnmount() {
this.isMountedOk = false;
}
}, {
key: "render",

@@ -103,0 +114,0 @@ value: function render() {

@@ -61,2 +61,3 @@ import React, { Component } from 'react';

};
private isMountedOk;
/**

@@ -69,2 +70,3 @@ * 全局可能存在多个 Loader 同时渲染, 但是只能由一个负责加载

componentDidMount(): void;
componentWillUnmount(): void;
render(): React.ReactNode;

@@ -71,0 +73,0 @@ private getScriptSrc;

@@ -22,2 +22,3 @@ import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";

super(props);
this.isMountedOk = false;
this.state = {

@@ -28,11 +29,15 @@ loaded: !!window.AMap

this.handleError = error => {
this.setState({
error
});
if (this.isMountedOk) {
this.setState({
error
});
}
};
this.finish = () => {
this.setState({
loaded: true
});
if (this.isMountedOk) {
this.setState({
loaded: true
});
}
};

@@ -46,2 +51,3 @@

componentDidMount() {
this.isMountedOk = true;
var {

@@ -61,2 +67,6 @@ callbackName

componentWillUnmount() {
this.isMountedOk = false;
}
render() {

@@ -63,0 +73,0 @@ if (this.state.loaded) {

{
"name": "@uiw/react-amap-api-loader",
"version": "2.6.2",
"version": "2.7.0",
"description": "用于加载高德地图 SDK 依赖,加载完成,全局将会有 **`window.AMap`** 对象。",

@@ -36,4 +36,4 @@ "homepage": "https://uiwjs.github.io/react-amap/#/api-loader",

"dependencies": {
"@uiw/react-amap-require-script": "2.6.2",
"@uiw/react-amap-types": "2.6.2"
"@uiw/react-amap-require-script": "2.7.0",
"@uiw/react-amap-types": "2.7.0"
},

@@ -40,0 +40,0 @@ "devDependencies": {

Sorry, the diff of this file is not supported yet

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