Add a few @internal
annotations
This commit is contained in:
parent
0a76a416ad
commit
d4b8da790c
@ -204,11 +204,20 @@ type RefType = React.Component<CameraProps> & Readonly<NativeMethods>;
|
|||||||
* @component
|
* @component
|
||||||
*/
|
*/
|
||||||
export class Camera extends React.PureComponent<CameraProps, CameraState> {
|
export class Camera extends React.PureComponent<CameraProps, CameraState> {
|
||||||
|
/**
|
||||||
|
* @internal
|
||||||
|
*/
|
||||||
static displayName = 'Camera';
|
static displayName = 'Camera';
|
||||||
|
/**
|
||||||
|
* @internal
|
||||||
|
*/
|
||||||
displayName = Camera.displayName;
|
displayName = Camera.displayName;
|
||||||
|
|
||||||
private readonly ref: React.RefObject<RefType>;
|
private readonly ref: React.RefObject<RefType>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @internal
|
||||||
|
*/
|
||||||
constructor(props: CameraProps) {
|
constructor(props: CameraProps) {
|
||||||
super(props);
|
super(props);
|
||||||
this.state = { cameraId: undefined };
|
this.state = { cameraId: undefined };
|
||||||
@ -451,6 +460,9 @@ export class Camera extends React.PureComponent<CameraProps, CameraState> {
|
|||||||
}
|
}
|
||||||
//#endregion
|
//#endregion
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @internal
|
||||||
|
*/
|
||||||
static getDerivedStateFromProps(props: CameraProps, state: CameraState): CameraState | null {
|
static getDerivedStateFromProps(props: CameraProps, state: CameraState): CameraState | null {
|
||||||
const newCameraId = props.device.id;
|
const newCameraId = props.device.id;
|
||||||
if (state.cameraId !== newCameraId) return { ...state, cameraId: newCameraId };
|
if (state.cameraId !== newCameraId) return { ...state, cameraId: newCameraId };
|
||||||
@ -458,6 +470,9 @@ export class Camera extends React.PureComponent<CameraProps, CameraState> {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @internal
|
||||||
|
*/
|
||||||
public render(): React.ReactNode {
|
public render(): React.ReactNode {
|
||||||
// We remove the big `device` object from the props because we only need to pass `cameraId` to native.
|
// We remove the big `device` object from the props because we only need to pass `cameraId` to native.
|
||||||
const { device: _, ...props } = this.props;
|
const { device: _, ...props } = this.props;
|
||||||
|
Loading…
Reference in New Issue
Block a user