Closed WeslleyNasRocha closed 5 years ago
With the following code, i got that result
export default class App extends Component { constructor(props) { super(props); this.state = { counter: 0 }; } startCounter() { clearInterval(this.counter); this.setState({ counter: 0 }, () => { this.counter = setInterval(() => { this.setState(prevState => ({ counter: prevState.counter + 1 })); }, 1000); }); } render() { return ( <View style={styles.container}> <View style={{ marginTop: 16 }}> <Text>{this.state.counter}</Text> </View> <Scanner ref={ref => (this.scanner = ref)} onPictureTaken={data => this.startCounter()} captureMultiple overlayColor='#1599' timeBeteweenCaptures={15} style={{ flex: 1, width, height }} /> <TouchableOpacity onPress={() => this.scanner.capture()}> <Text>Take Picture</Text> </TouchableOpacity> </View> ); } }
Imgur Gif was to big to put it here
on my project i need these changes, i will make another pull request only with the feature
With the following code, i got that result
Imgur Gif was to big to put it here