fix: Run setFrameProcessor
after interactions have completed
This commit is contained in:
parent
26d19d5152
commit
4baf58429c
@ -1,5 +1,13 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { requireNativeComponent, NativeModules, NativeSyntheticEvent, findNodeHandle, NativeMethods, Platform } from 'react-native';
|
import {
|
||||||
|
requireNativeComponent,
|
||||||
|
NativeModules,
|
||||||
|
NativeSyntheticEvent,
|
||||||
|
findNodeHandle,
|
||||||
|
NativeMethods,
|
||||||
|
Platform,
|
||||||
|
InteractionManager,
|
||||||
|
} from 'react-native';
|
||||||
import type { CameraDevice } from './CameraDevice';
|
import type { CameraDevice } from './CameraDevice';
|
||||||
import type { ErrorWithCause } from './CameraError';
|
import type { ErrorWithCause } from './CameraError';
|
||||||
import { CameraCaptureError, CameraRuntimeError, tryParseNativeCameraError, isErrorWithCause } from './CameraError';
|
import { CameraCaptureError, CameraRuntimeError, tryParseNativeCameraError, isErrorWithCause } from './CameraError';
|
||||||
@ -363,7 +371,12 @@ export class Camera extends React.PureComponent<CameraProps> {
|
|||||||
* @internal
|
* @internal
|
||||||
*/
|
*/
|
||||||
componentDidMount(): void {
|
componentDidMount(): void {
|
||||||
if (this.props.frameProcessor != null) this.setFrameProcessor(this.props.frameProcessor);
|
const frameProcessor = this.props.frameProcessor;
|
||||||
|
if (frameProcessor != null) {
|
||||||
|
InteractionManager.runAfterInteractions(() => {
|
||||||
|
this.setFrameProcessor(frameProcessor);
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user