GLCanvas.captureFrame.android.js 502 Bytes
Newer Older
1
import invariant from "invariant";
2
import {UIManager, NativeModules} from "react-native";
3
const GLCanvas = UIManager.getViewManagerConfig('GLCanvas');
4 5 6 7 8
invariant(GLCanvas,
`gl-react-native: the native module is not available.
Make sure you have properly configured it.
See README install instructions.

Gaëtan Renaudeau's avatar
Gaëtan Renaudeau committed
9
NativeModules.UIManager.GLCanvas is %s`, GLCanvas);
10 11
const {Commands} = GLCanvas;

12
module.exports = (handle, config) => UIManager.dispatchViewManagerCommand(handle, Commands.captureFrame, [ config ]);