purple-technology / react-camera-pro

Mobile first camera component for React.
MIT License
182 stars 89 forks source link

errorMessages in props is not optional #63

Open mst-mkt opened 2 months ago

mst-mkt commented 2 months ago

The errorMessages in the props of the Camera component is not optional.

Therefore, the following error occurs if props is omitted as follows.

 <Camera ref={cameraRef} />
Property 'errorMessages' is missing in type '{ ref: RefObject<CameraType>; aspectRatio: number; }' but required in type 'CameraProps'.ts

To resolve the error, it should be stated as such.

 <Camera ref={cameraRef} errorMessages={{}} />

The README is marked as optional, as shown below, so this is considered to be an implementation error. https://github.com/purple-technology/react-camera-pro/blob/master/README.md?plain=1#L74