Skip to content

Commit

Permalink
Merge pull request #66 from brigand/react-0.14
Browse files Browse the repository at this point in the history
updates to react 0.14
  • Loading branch information
mosch committed Oct 10, 2015
2 parents 2428e5b + a44e99d commit b921589
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
7 changes: 4 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
var React = require('react');
var ReactDOM = require('react-dom');

var isTouchDevice =
!!(typeof window !== 'undefined' &&
Expand Down Expand Up @@ -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);
}
Expand All @@ -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);
Expand Down Expand Up @@ -338,4 +339,4 @@ var AvatarEditor = React.createClass({
}
});

export default AvatarEditor;
export default AvatarEditor;
13 changes: 7 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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"
}
}

0 comments on commit b921589

Please sign in to comment.