How to use the expo-core.requireNativeViewManager function in expo-core

To help you get started, we’ve selected a few expo-core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github expo / expo / modules / expo-gl / src / GLView.js View on Github external
this.props.nativeRef_EXPERIMENTAL(nativeRef);
    }
    this.nativeRef = nativeRef;
  };

  _onSurfaceCreate = ({ nativeEvent: { exglCtxId } }: SurfaceCreateEvent) => {
    const gl = getGl(exglCtxId);

    this.exglCtxId = exglCtxId;

    if (this.props.onContextCreate) {
      this.props.onContextCreate(gl);
    }
  };

  static NativeView = requireNativeViewManager('ExponentGLView', GLView);

  startARSessionAsync() {
    return ExponentGLViewManager.startARSessionAsync(findNodeHandle(this.nativeRef));
  }

  async createCameraTextureAsync(cameraRef: React.Node) {
    const { exglCtxId } = this;

    if (!exglCtxId) {
      throw new Error('GLView\'s surface is not created yet!');
    }

    const cameraTag = findNodeHandle(cameraRef);
    const { exglObjId } = await ExponentGLObjectManager.createCameraTextureAsync(
      exglCtxId,
      cameraTag
github expo / expo / modules / expo-camera / src / Camera.js View on Github external
return newProps;
  }

  _convertProp(value: *, key: string): * {
    if (typeof value === 'string' && Camera.ConversionTables[key]) {
      return Camera.ConversionTables[key][value];
    }

    return value;
  }
}

export const Constants = Camera.Constants;

const ExponentCamera = requireNativeViewManager('ExponentCamera', Camera);
github expo / expo / modules / expo-ads-admob / src / PublisherBanner.js View on Github external
testDeviceID={this.props.testDeviceID}
          onSizeChange={this._handleSizeChange}
          onAdViewDidReceiveAd={this.props.onAdViewDidReceiveAd}
          onDidFailToReceiveAdWithError={this._handleDidFailToReceiveAdWithError}
          onAdViewWillPresentScreen={this.props.onAdViewWillPresentScreen}
          onAdViewWillDismissScreen={this.props.onAdViewWillDismissScreen}
          onAdViewDidDismissScreen={this.props.onAdViewDidDismissScreen}
          onAdViewWillLeaveApplication={this.props.onAdViewWillLeaveApplication}
          onAdmobDispatchAppEvent={this.props.onAdMobDispatchAppEvent}
        />
      
    );
  }
}

const ExpoBannerView = requireNativeViewManager('ExpoAdsPublisherBannerView', PublisherBanner);
github expo / expo / packages / expo-camera / src / Camera.js View on Github external
}

    return value;
  }
}

function flipCameraStyle(shouldFlip) {
  if (shouldFlip) {
    return { transform: 'rotateY(180deg)' };
  }
  return { transform: 'none' };
}

let ExponentCamera = null;
if (Platform.OS !== 'web') {
  ExponentCamera = requireNativeViewManager('ExponentCamera', Camera);
}

export const Constants = Camera.Constants;
github expo / expo / modules / expo-ads-admob / src / AdMobBanner.js View on Github external
bannerSize={this.props.bannerSize}
          testDeviceID={this.props.testDeviceID}
          onSizeChange={this._handleSizeChange}
          onAdViewDidReceiveAd={this.props.onAdViewDidReceiveAd}
          onDidFailToReceiveAdWithError={this._handleDidFailToReceiveAdWithError}
          onAdViewWillPresentScreen={this.props.onAdViewWillPresentScreen}
          onAdViewWillDismissScreen={this.props.onAdViewWillDismissScreen}
          onAdViewDidDismissScreen={this.props.onAdViewDidDismissScreen}
          onAdViewWillLeaveApplication={this.props.onAdViewWillLeaveApplication}
        />
      
    );
  }
}

const ExpoBannerView = requireNativeViewManager('ExpoAdsAdMobBannerView', AdMobBanner);
github expo / expo / modules / expo-barcode-scanner / src / BarCodeScanner.js View on Github external
convertNativeProps(props: Props) {
    const newProps = mapValues(props, this.convertProp);
    return newProps;
  }

  convertProp(value: *, key: string): * {
    if (typeof value === 'string' && BarCodeScanner.ConversionTables[key]) {
      return BarCodeScanner.ConversionTables[key][value];
    }
    return value;
  }
}

export const Constants = BarCodeScanner.Constants;

const ExpoBarCodeScannerView = requireNativeViewManager('ExpoBarCodeScannerView', BarCodeScanner);