import invariant from "invariant"; import {UIManager, NativeModules} from "react-native"; const GLCanvas = UIManager.getViewManagerConfig('GLCanvas'); invariant(GLCanvas, `gl-react-native: the native module is not available. Make sure you have properly configured it. See README install instructions. NativeModules.UIManager.GLCanvas is %s`, GLCanvas); const {Commands} = GLCanvas; module.exports = (handle, config) => UIManager.dispatchViewManagerCommand(handle, Commands.captureFrame, [ config ]);