GithubHelp home page GithubHelp logo

Comments (6)

imomer avatar imomer commented on May 13, 2024 1

@moaazsidat there is a bug in this module. When you try to navigate to another component and come back to scanner it closes the app.

render() {
        return (
            <QRCodeScanner
                onRead={this.onSuccess.bind(this)}
                containerStyle={{backgroundColor: '#ffffff'}}
                showMarker={true}
                topViewStyle={{flex: 0, height: 0}}
                bottomContent={(
                    <TouchableOpacity onPress={this.gotoHome}>
                        <Text>OK. Got it!</Text>
                    </TouchableOpacity>
                )}
                ref={(node) => { this.scanner = node }}
                reactivate = {true}
                reactivateTimeout = {5000}
            />
        );
    }

gotoHome = () => {
        this.props.navigation.navigate('Home');
    }

from react-native-qrcode-scanner.

moaazsidat avatar moaazsidat commented on May 13, 2024

Hey @victorsferreira, will take a look at ReactNavigation, and try to add a couple of examples using it. Since this is just a react component, you should generally be able to use it as any other component.

import QRCodeScanner from 'react-native-qrcode-scanner'

<QRCodeScanner
  title='Scan Code'
  onRead={() => alert('Success')}
  topContent={(
    <Text style={styles.centerText}>
      Go to <Text style={styles.textBold}>wikipedia.org/wiki/QR_code</Text> on your computer and scan the QR code.
    </Text>
  )}
  bottomContent={(
    <TouchableOpacity style={styles.buttonTouchable}>
      <Text style={styles.buttonText}>OK. Got it!</Text>
    </TouchableOpacity>
  )}
/> 

from react-native-qrcode-scanner.

lucasharada avatar lucasharada commented on May 13, 2024

@imomer @victorsferreira Any solution on this? I'm having this issue when creating a StackNavigator with this Component.

from react-native-qrcode-scanner.

imomer avatar imomer commented on May 13, 2024

@lucasharada well didn't find a solution but I have worked around it

from react-native-qrcode-scanner.

lucasharada avatar lucasharada commented on May 13, 2024

@imomer Can you show us how you did it?

from react-native-qrcode-scanner.

afilp avatar afilp commented on May 13, 2024

@imomer Can you please show us the workaround? The app also crashes...

from react-native-qrcode-scanner.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.