From 99972cd93900aa72a3eb9618738aa4dd5ef8fac7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Renaudeau?= Date: Sat, 2 Jul 2016 11:11:58 +0200 Subject: [PATCH] Fixes https://github.com/ProjectSeptemberInc/gl-react/issues/64 --- src/index.js | 2 ++ src/makeSurface.js | 1 + 2 files changed, 3 insertions(+) diff --git a/src/index.js b/src/index.js index 463bf1a..e21431c 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 429193d..f8636b4 100644 --- a/src/makeSurface.js +++ b/src/makeSurface.js @@ -50,5 +50,6 @@ export default C => { renderVcontent, renderVGL, getPixelRatio, + C.getGLCanvas, ); }; -- 2.26.2