Skip to content

Commit

Permalink
update deps, remove id warning
Browse files Browse the repository at this point in the history
  • Loading branch information
lavrton committed Mar 23, 2019
1 parent 1b808bd commit 3a8b162
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 26 deletions.
16 changes: 5 additions & 11 deletions lib/makeUpdates.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ var propsToSkip = {
unstable_applyCache: true,
unstable_applyDrawHitFromCache: true
};
var idWarningShowed = false;

var zIndexWarningShowed = false;
var dragWarningShowed = false;

Expand All @@ -27,15 +27,9 @@ function toggleStrictMode(value) {
function applyNodeProps(instance, props) {
var oldProps = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};

if (!idWarningShowed && 'id' in props) {
var message = 'ReactKonva: You are using "id" attribute for a Konva node. In some very rare cases it may produce bugs. Currently we recommend not to use it and use "name" attribute instead.\nYou are using id = "' + props.id + '".\nFor more info see: https://github.com/konvajs/react-konva/issues/119';
console.warn(message);
idWarningShowed = true;
}

if (!zIndexWarningShowed && 'zIndex' in props) {
var _message = 'ReactKonva: You are using "zIndex" attribute for a Konva node.\nreact-konva may get confused with ordering. Just define correct order of elements in your render function of a component.\nFor more info see: https://github.com/konvajs/react-konva/issues/194\n';
console.warn(_message);
var message = 'ReactKonva: You are using "zIndex" attribute for a Konva node.\nreact-konva may get confused with ordering. Just define correct order of elements in your render function of a component.\nFor more info see: https://github.com/konvajs/react-konva/issues/194\n';
console.warn(message);
zIndexWarningShowed = true;
}

Expand All @@ -44,8 +38,8 @@ function applyNodeProps(instance, props) {
var hasPosition = props.x !== undefined || props.y !== undefined;
var hasEvents = props.onDragEnd || props.onDragMove;
if (hasPosition && !hasEvents) {
var _message2 = 'ReactKonva: You have a Konva node with draggable = true and position defined but no onDragMove or onDragEnd events are handled.\nPosition of a node will be changed during drag&drop, so you should update state of the react app as well.\nConsider to add onDragMove or onDragEnd events.\nFor more info see: https://github.com/konvajs/react-konva/issues/256\n';
console.warn(_message2);
var _message = 'ReactKonva: You have a Konva node with draggable = true and position defined but no onDragMove or onDragEnd events are handled.\nPosition of a node will be changed during drag&drop, so you should update state of the react app as well.\nConsider to add onDragMove or onDragEnd events.\nFor more info see: https://github.com/konvajs/react-konva/issues/256\n';
console.warn(_message);
dragWarningShowed = true;
}
}
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,23 @@
"url": "[email protected]:konvajs/react-konva.git"
},
"dependencies": {
"react-reconciler": "^0.20.2",
"scheduler": "^0.13.4"
"react-reconciler": "^0.20.3",
"scheduler": "^0.13.5"
},
"peerDependencies": {
"react": "16.8.x",
"react-dom": "16.8.x",
"konva": "^2.0.0 || ^3.0.0"
"konva": "^3.2.3"
},
"devDependencies": {
"chai": "^4.2.0",
"enzyme": "^3.9.0",
"enzyme-adapter-react-16": "^1.10.0",
"enzyme-adapter-react-16": "^1.11.2",
"konva": "^3.2.0",
"nwb": "^0.23.0",
"react": "16.8.4",
"react-dom": "16.8.4",
"sinon": "^7.2.7",
"sinon": "^7.3.0",
"use-image": "^1.0.3"
},
"scripts": {
Expand Down
10 changes: 1 addition & 9 deletions src/makeUpdates.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const propsToSkip = {
unstable_applyCache: true,
unstable_applyDrawHitFromCache: true
};
let idWarningShowed = false;

let zIndexWarningShowed = false;
let dragWarningShowed = false;

Expand All @@ -19,14 +19,6 @@ export function toggleStrictMode(value) {
}

export function applyNodeProps(instance, props, oldProps = {}) {
if (!idWarningShowed && 'id' in props) {
const message = `ReactKonva: You are using "id" attribute for a Konva node. In some very rare cases it may produce bugs. Currently we recommend not to use it and use "name" attribute instead.
You are using id = "${props.id}".
For more info see: https://github.com/konvajs/react-konva/issues/119`;
console.warn(message);
idWarningShowed = true;
}

if (!zIndexWarningShowed && 'zIndex' in props) {
const message = `ReactKonva: You are using "zIndex" attribute for a Konva node.
react-konva may get confused with ordering. Just define correct order of elements in your render function of a component.
Expand Down
2 changes: 1 addition & 1 deletion tests/index-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ describe.skip('Bad structure', () => {
// that creates mess in id references
// see: https://github.com/konvajs/react-konva/issues/119

describe.skip('Check id saving', () => {
describe('Check id saving', () => {
it('Konva can loose ids?', function() {
class App extends React.Component {
render() {
Expand Down

0 comments on commit 3a8b162

Please sign in to comment.