Open heyajohnny opened 6 months ago
FYI: you can disable the warning for yourself (while waiting on someone to update the library) by adding this line after you import the Camera component:
Camera.defaultProps = undefined
NOTE: there is one defaultProp specified, isDisplayStartCameraError = true
so you will probably want to set this to true when you instance the component eg:
<Camera
idealFacingMode='environment'
onTakePhoto = {(dataUri) => {
handleTakePhoto(dataUri)
}}
isDisplayStartCameraError
/>
@heyajohnny, thank for opening this issue, the code will be updated.
Running on react 18.3.1 I get these errors:
According to AI, this should be the fix: Here’s an example of how you can transition from defaultProps to default parameters in a functional component:
Using default parameters simplifies the component and aligns with modern JavaScript practices. It’s a good idea to start refactoring your components to use default parameters if you haven’t already, to prepare for the upcoming changes in React.