Skip to content

Commit

Permalink
fix: Fix componentDidUpdate() Frame Processor comparison (#2880)
Browse files Browse the repository at this point in the history
Currently the if statement is always true since ReadonlyFrameProcesser != FrameProcessor
  • Loading branch information
nmajumder12 committed May 15, 2024
1 parent 5a26928 commit e03b7f1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion package/src/Camera.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ export class Camera extends React.PureComponent<CameraProps, CameraState> {
componentDidUpdate(): void {
if (!this.isNativeViewMounted) return
const frameProcessor = this.props.frameProcessor
if (frameProcessor !== this.lastFrameProcessor) {
if (frameProcessor?.frameProcessor !== this.lastFrameProcessor) {
// frameProcessor argument identity changed. Update native to reflect the change.
if (frameProcessor != null) this.setFrameProcessor(frameProcessor.frameProcessor)
else this.unsetFrameProcessor()
Expand Down

0 comments on commit e03b7f1

Please sign in to comment.