|
2 | 2 |
|
3 | 3 | var React = require('react'); |
4 | 4 | var ReactUpdates = require('react/lib/ReactUpdates'); |
5 | | -var invariant = require('react/lib/invariant'); |
| 5 | +var invariant = require('fbjs/lib/invariant'); |
6 | 6 | var ContainerMixin = require('./ContainerMixin'); |
7 | 7 | var RenderLayer = require('./RenderLayer'); |
8 | 8 | var FrameUtils = require('./FrameUtils'); |
@@ -120,7 +120,7 @@ var Surface = React.createClass({ |
120 | 120 | this.isMounted(), |
121 | 121 | 'Tried to access drawing context on an unmounted Surface.' |
122 | 122 | ) : invariant(this.isMounted())); |
123 | | - return this.refs.canvas.getDOMNode().getContext('2d'); |
| 123 | + return this.refs.canvas.getContext('2d'); |
124 | 124 | }, |
125 | 125 |
|
126 | 126 | scale: function () { |
@@ -170,14 +170,14 @@ var Surface = React.createClass({ |
170 | 170 | // ====== |
171 | 171 |
|
172 | 172 | hitTest: function (e) { |
173 | | - var hitTarget = hitTest(e, this.node, this.getDOMNode()); |
| 173 | + var hitTarget = hitTest(e, this.node, this.refs.canvas); |
174 | 174 | if (hitTarget) { |
175 | 175 | hitTarget[hitTest.getHitHandle(e.type)](e); |
176 | 176 | } |
177 | 177 | }, |
178 | 178 |
|
179 | 179 | handleTouchStart: function (e) { |
180 | | - var hitTarget = hitTest(e, this.node, this.getDOMNode()); |
| 180 | + var hitTarget = hitTest(e, this.node, this.refs.canvas); |
181 | 181 | var touch; |
182 | 182 | if (hitTarget) { |
183 | 183 | // On touchstart: capture the current hit target for the given touch. |
|
0 commit comments