diff --git a/src/index.js b/src/index.js index 463bf1a918228f53e72a949d5d1ad99750d3a363..e21431c505d84f9e21d82408e4f1966e42321364 100644 --- a/src/index.js +++ b/src/index.js @@ -46,6 +46,7 @@ module.exports = { Surface: makeSurface({ View, GLCanvas, + getGLCanvas: glSurface => glSurface.refs.canvas, dimensionInvariant: (value, field) => isAnimated(value) ? invariant(false, "GL.Surface "+field+" prop cannot be an Animated object. Use GL.AnimatedSurface instead") @@ -54,6 +55,7 @@ module.exports = { AnimatedSurface: makeSurface({ View: Animated.View, GLCanvas: Animated.createAnimatedComponent(GLCanvas), + getGLCanvas: glSurface => glSurface.refs.canvas.refs.node, dimensionInvariant: (value, field) => invariant( isAnimated(value) || typeof value === "number" && value > 0, diff --git a/src/makeSurface.js b/src/makeSurface.js index 429193d5baaaefd9a4acc32f0c1bc908749d66cd..f8636b493563f400bb9eec41f07bbe9368aefe3a 100644 --- a/src/makeSurface.js +++ b/src/makeSurface.js @@ -50,5 +50,6 @@ export default C => { renderVcontent, renderVGL, getPixelRatio, + C.getGLCanvas, ); };