@momo-kits/camerakit 0.89.4 → 0.89.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import React, {forwardRef, useImperativeHandle, useRef} from 'react';
2
2
 
3
3
  import {
4
4
  findNodeHandle,
@@ -18,10 +18,10 @@ if (NativeModules?.RNCameraKitModule) {
18
18
  NativeCamera = requireNativeComponent('CKCameraManager');
19
19
  }
20
20
 
21
- const Camera = React.forwardRef((props: any, ref) => {
22
- const nativeRef = React.useRef();
21
+ const Camera = forwardRef((props: any, ref) => {
22
+ const nativeRef = useRef();
23
23
 
24
- React.useImperativeHandle<any, CameraApi>(ref, () => ({
24
+ useImperativeHandle<any, CameraApi>(ref, () => ({
25
25
  capture: async (options = {}) => {
26
26
  return await Module.capture(
27
27
  options,
package/index.tsx CHANGED
@@ -1,4 +1,4 @@
1
- import React, {useRef} from 'react';
1
+ import React, {forwardRef, useImperativeHandle, useRef} from 'react';
2
2
  import {Platform, StyleSheet, View} from 'react-native';
3
3
  import styles from './styles';
4
4
  import CameraIOS from './Camera.ios';
@@ -9,7 +9,7 @@ const Camera = Platform.OS == 'ios' ? CameraIOS : CameraAndroid;
9
9
 
10
10
  const ThrottleEvent = 500;
11
11
 
12
- const CameraKit = React.forwardRef(
12
+ const CameraKit = forwardRef(
13
13
  (
14
14
  {
15
15
  onBarCodeRead,
@@ -26,7 +26,7 @@ const CameraKit = React.forwardRef(
26
26
  const lastEvent = useRef<any>(null);
27
27
  const lastTime = useRef<number>(0);
28
28
 
29
- React.useImperativeHandle<any, CameraApi>(ref, () => ({
29
+ useImperativeHandle<any, CameraApi>(ref, () => ({
30
30
  capture,
31
31
  startCamera,
32
32
  stopCamera,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/camerakit",
3
- "version": "0.89.4",
3
+ "version": "0.89.6",
4
4
  "private": false,
5
5
  "main": "index.tsx",
6
6
  "peerDependencies": {