Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Update type definition to really reflect what the package is capable of and benefit from TypeScript autocompletion and warnings
Update documentation accordingly, add missing parameters, change it slightly so it reflects the actual feature set
It completes the fix for this issue #524
It does fix that issue #498, by using
cameraType
It is mainly cosmetic changes to add types and fix TypeScript warnings. Though, there is a few other related changes
<CameraScreen/>
. like settingcameraType
end up settingcameraType
of the<Camera />
surfaceColor
,rightButtonText
(which means allowCaptureRetake is broken, but that's another subject)this.props.cameraFlipImageStyle
as a styleflashImageStyle
instead of re-usingtorchImageStyle
for flash state button, which is a different button on screenthis.props.torchOnImage
&&this.props.torchOffImage
orthis.state.flashData?.image
are defined before to show the buttonsHow did you test this change?
As is, it's hard to test. It has been tested on top of #544 with the example app on real devices for both platforms.
All buttons work as expected. There is no more warnings from TypeScript