From a44e99d00ef496e67b4a55172f7bdc6f8093998a Mon Sep 17 00:00:00 2001 From: Frankie Bagnardi Date: Wed, 7 Oct 2015 03:33:38 -0700 Subject: [PATCH] updates to react 0.14 --- index.js | 7 ++++--- package.json | 13 +++++++------ 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/index.js b/index.js index 5556bb4..9979910 100644 --- a/index.js +++ b/index.js @@ -1,4 +1,5 @@ var React = require('react'); +var ReactDOM = require('react-dom'); var isTouchDevice = !!(typeof window !== 'undefined' && @@ -126,7 +127,7 @@ var AvatarEditor = React.createClass({ }, componentDidMount() { - var context = React.findDOMNode(this.refs.canvas).getContext('2d'); + var context = ReactDOM.findDOMNode(this.refs.canvas).getContext('2d'); if (this.props.image) { this.loadImage(this.props.image); } @@ -143,7 +144,7 @@ var AvatarEditor = React.createClass({ }, componentDidUpdate() { - var context = React.findDOMNode(this.refs.canvas).getContext('2d'); + var context = ReactDOM.findDOMNode(this.refs.canvas).getContext('2d'); context.clearRect(0, 0, this.getDimensions().canvas.width, this.getDimensions().canvas.height); this.paint(context); this.paintImage(context, this.state.image, this.props.border); @@ -338,4 +339,4 @@ var AvatarEditor = React.createClass({ } }); -export default AvatarEditor; \ No newline at end of file +export default AvatarEditor; diff --git a/package.json b/package.json index a1c9d9f..693e5b0 100644 --- a/package.json +++ b/package.json @@ -4,10 +4,10 @@ "description": "Facebook like avatar / profile picture component. Resize and crop your uploaded image using a intuitive user interface.", "main": "dist/index.js", "scripts": { - "demo": "watchify -t reactify example/app.js -o example/bundle.js -v", - "build": "babel --modules umd index.js | uglifyjs > dist/index.js", + "demo": "watchify -t reactify example/app.js -o example/bundle.js -v", + "build": "babel --modules umd index.js | uglifyjs > dist/index.js", "build-debug": "babel --modules umd index.js > dist/index.js", - "watch": "babel --modules umd index.js -w -o dist/index.js" + "watch": "babel --modules umd index.js -w -o dist/index.js" }, "author": { "name": "Moritz Schwoerer", @@ -36,10 +36,11 @@ ], "devDependencies": { "babel": "^5.5.8", - "react": "0.13.x", "http-server": "^0.7.4", - "watchify": "^3.2.2", + "react": "^0.14.0", + "react-dom": "^0.14.0", "reactify": "0.17.1", - "uglifyjs": "^2.4.10" + "uglifyjs": "^2.4.10", + "watchify": "^3.2.2" } }