File tree Expand file tree Collapse file tree 2 files changed +5
-15
lines changed
src/components/VideoCapture Expand file tree Collapse file tree 2 files changed +5
-15
lines changed Original file line number Diff line number Diff line change @@ -200,12 +200,7 @@ class VideoCapture extends React.Component {
200200 this .cameraEnhancer ?.dispose ();
201201 } catch (_ ) {}
202202 }
203-
204- shouldComponentUpdate() {
205- // Never update UI after mount, sdk use native way to bind event, update will remove it.
206- return false ;
207- }
208-
203+
209204 render() {
210205 return (
211206 <div >
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ const componentDestroyedErrorMsg = "VideoCapture Component Destroyed";
99
1010class VideoCapture extends React . Component {
1111 state = {
12- resultText : ""
12+ resultText : "" ,
1313 } ;
1414 cameraViewContainer : React . RefObject < HTMLDivElement > = React . createRef ( ) ;
1515
@@ -47,13 +47,13 @@ class VideoCapture extends React.Component {
4747 this . cvRouter . addResultReceiver ( {
4848 onDecodedBarcodesReceived : ( result ) => {
4949 if ( ! result . barcodeResultItems . length ) return ;
50-
50+
5151 let _resultText = "" ;
5252 console . log ( result ) ;
5353 for ( let item of result . barcodeResultItems ) {
5454 _resultText += `${ item . formatString } : ${ item . text } \n\n` ;
5555 }
56- this . setState ( { resultText : _resultText } )
56+ this . setState ( { resultText : _resultText } ) ;
5757 } ,
5858 } ) ;
5959
@@ -102,15 +102,10 @@ class VideoCapture extends React.Component {
102102 } catch ( _ ) { }
103103 }
104104
105- shouldComponentUpdate ( ) {
106- // Never update UI after mount, sdk use native way to bind event, update will remove it.
107- return false ;
108- }
109-
110105 render ( ) {
111106 return (
112107 < div >
113- < div ref = { this . cameraViewContainer } style = { { width : "100%" , height : "70vh" } } > </ div >
108+ < div ref = { this . cameraViewContainer } style = { { width : "100%" , height : "70vh" } } > </ div >
114109 < br />
115110 Results:
116111 < div className = "results" > { this . state . resultText } </ div >
You can’t perform that action at this time.
0 commit comments