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

react-konva-utils

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-konva-utils - npm Package Compare versions

Comparing version 0.2.0 to 0.3.0

LICENSE

18

es/html.js

@@ -13,3 +13,3 @@ var __rest = (this && this.__rest) || function (s, e) {

import React from 'react';
import ReactDOM from 'react-dom';
import ReactDOM from 'react-dom/client';
import { Group } from 'react-konva';

@@ -24,8 +24,6 @@ const needForceStyle = (el) => {

const container = React.useRef();
const [div] = React.useState(() => document.createElement('div'));
const root = React.useMemo(() => ReactDOM.createRoot(div), [div]);
const shouldTransform = transform !== null && transform !== void 0 ? transform : true;
const handleTransform = () => {
const div = container.current;
if (!div) {
return;
}
if (shouldTransform && groupRef.current) {

@@ -66,4 +64,2 @@ const tr = groupRef.current.getAbsoluteTransform();

}
let div = document.createElement('div');
container.current = div;
parent.appendChild(div);

@@ -78,3 +74,2 @@ if (shouldTransform && needForceStyle(parent)) {

group.off('absoluteTransformChange', handleTransform);
ReactDOM.unmountComponentAtNode(div);
(_a = div.parentNode) === null || _a === void 0 ? void 0 : _a.removeChild(div);

@@ -87,5 +82,10 @@ };

React.useLayoutEffect(() => {
ReactDOM.render(children, container.current);
root.render(children);
});
React.useEffect(() => {
return () => {
root.unmount();
};
}, []);
return React.createElement(Group, Object.assign({ ref: groupRef }, groupProps));
};
{
"name": "react-konva-utils",
"version": "0.2.0",
"version": "0.3.0",
"description": "Useful components and hooks for react-konva",

@@ -12,10 +12,11 @@ "author": "Anton Lavrenov",

],
"license": "MIT",
"dependencies": {
"react-konva": "^17.0.2-4",
"use-image": "^1.0.7"
"react-konva": "^18.0.0-0",
"use-image": "^1.0.12"
},
"peerDependencies": {
"konva": "8.x",
"react": "^17.0.2",
"react-dom": "^17.0.2"
"konva": "^8.3.5",
"react": "^18.0.0",
"react-dom": "^18.0.0"
},

@@ -29,15 +30,15 @@ "types": "./es/index.d.ts",

"devDependencies": {
"@babel/core": "^7.13.14",
"@storybook/addon-actions": "^6.2.2",
"@storybook/core-server": "^6.3.0",
"@storybook/addon-essentials": "^6.2.2",
"@storybook/addon-links": "^6.2.2",
"@storybook/core": "^6.3.0",
"@storybook/react": "^6.2.2",
"@types/react": "^17.0.3",
"babel-loader": "^8.2.2",
"@babel/core": "^7.17.9",
"@storybook/addon-actions": "^6.5.0-alpha.61",
"@storybook/addon-essentials": "^6.5.0-alpha.61",
"@storybook/addon-links": "^6.5.0-alpha.61",
"@storybook/core": "^6.5.0-alpha.61",
"@storybook/core-server": "^6.5.0-alpha.61",
"@storybook/react": "^6.5.0-alpha.61",
"@types/react": "^18.0.1",
"babel-loader": "^8.2.4",
"parcel-bundler": "^1.12.4",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"typescript": "^4.2.3"
"react": "^18.0.0",
"react-dom": "^18.0.0",
"typescript": "^4.6.3"
},

@@ -44,0 +45,0 @@ "scripts": {

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