From d4b8da790cf445c6e793e4bb7a816209d5a319c8 Mon Sep 17 00:00:00 2001 From: Marc Rousavy Date: Sun, 7 Mar 2021 14:23:14 +0100 Subject: [PATCH] Add a few `@internal` annotations --- src/Camera.tsx | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/Camera.tsx b/src/Camera.tsx index 7a04bee..a13bfb4 100644 --- a/src/Camera.tsx +++ b/src/Camera.tsx @@ -204,11 +204,20 @@ type RefType = React.Component & Readonly; * @component */ export class Camera extends React.PureComponent { + /** + * @internal + */ static displayName = 'Camera'; + /** + * @internal + */ displayName = Camera.displayName; private readonly ref: React.RefObject; + /** + * @internal + */ constructor(props: CameraProps) { super(props); this.state = { cameraId: undefined }; @@ -451,6 +460,9 @@ export class Camera extends React.PureComponent { } //#endregion + /** + * @internal + */ static getDerivedStateFromProps(props: CameraProps, state: CameraState): CameraState | null { const newCameraId = props.device.id; if (state.cameraId !== newCameraId) return { ...state, cameraId: newCameraId }; @@ -458,6 +470,9 @@ export class Camera extends React.PureComponent { return null; } + /** + * @internal + */ public render(): React.ReactNode { // We remove the big `device` object from the props because we only need to pass `cameraId` to native. const { device: _, ...props } = this.props;