Socket
Socket
Sign inDemoInstall

@uiw/react-amap-utils

Package Overview
Dependencies
Maintainers
0
Versions
103
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 6.0.5 to 7.0.0

6

cjs/usePortal.js

@@ -12,5 +12,8 @@ "use strict";

var _reactDom = require("react-dom");
var _client = require("react-dom/client");
var usePortal = exports.usePortal = function usePortal() {
var ref = (0, _react.useRef)();
var _React$useState = _react["default"].useState(function () {
var el = document.createElement('div');
ref.current = (0, _client.createRoot)(el);
return el;

@@ -38,3 +41,4 @@ }),

var remove = function remove(elm) {
elm && (0, _reactDom.unmountComponentAtNode)(elm);
var _ref$current;
elm && ((_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.unmount());
};

@@ -41,0 +45,0 @@ return {

10

esm/usePortal.js

@@ -1,6 +0,9 @@

import React, { useState, useEffect } from 'react';
import { createPortal, unmountComponentAtNode } from 'react-dom';
import React, { useState, useEffect, useRef } from 'react';
import { createPortal } from 'react-dom';
import { createRoot } from 'react-dom/client';
export var usePortal = () => {
var ref = useRef();
var [container] = React.useState(() => {
var el = document.createElement('div');
ref.current = createRoot(el);
return el;

@@ -21,3 +24,4 @@ });

var remove = elm => {
elm && unmountComponentAtNode(elm);
var _ref$current;
elm && ((_ref$current = ref.current) == null ? void 0 : _ref$current.unmount());
};

@@ -24,0 +28,0 @@ return {

{
"name": "@uiw/react-amap-utils",
"version": "6.0.5",
"version": "7.0.0",
"description": "基于 React 封装的高德地图组件。AMap Component Based On React.",

@@ -33,8 +33,8 @@ "funding": "https://jaywcjlove.github.io/#/sponsor",

"peerDependencies": {
"react": ">=16.14.0",
"react-dom": ">=16.14.0"
"react": "^18.0.0",
"react-dom": "^18.0.0"
},
"dependencies": {
"@uiw/react-amap-types": "6.0.5"
"@uiw/react-amap-types": "7.0.0"
}
}

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