From f035e32b30206888e13885c9276ccc19df6abd65 Mon Sep 17 00:00:00 2001 From: Stefan Dobrev Date: Fri, 6 Jan 2017 09:44:45 +0200 Subject: [PATCH] Handle string values for captureTarget prop (#543) This change adds a conversion for string values of captureTarget property. --- index.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/index.js b/index.js index dacbabc..c797285 100644 --- a/index.js +++ b/index.js @@ -41,6 +41,10 @@ function convertNativeProps(props) { if (typeof props.captureMode === 'string') { newProps.captureMode = Camera.constants.CaptureMode[props.captureMode]; } + + if (typeof props.captureTarget === 'string') { + newProps.captureTarget = Camera.constants.CaptureTarget[props.captureTarget]; + } // do not register barCodeTypes if no barcode listener if (typeof props.onBarCodeRead !== 'function') {