Giter Site home page Giter Site logo

react-native-pda-scan's People

Contributors

joseduin avatar michaelhao25 avatar xujin186 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

react-native-pda-scan's Issues

PDA scanner not working

React native version: 0.63.2
PDA scanner device: ZKC PDA3501

Event callbacks provided in the usePdaScan hook not triggering.

const {code, error} = usePdaScan({
onEvent: (code) => {
console.tron.log('usePdaScan', code);
},
onError: (error) => {
console.tron.log('usePdaScan err', error);
},
trigger: 'always', //always: An event is triggered each time the code is scanned。 change:Events are triggered when changes occur
});

Can you please help me regarding this. Your package is the only hope of solving this feature for me

How to Use on hooks component?

This is what I do:

import React, { useEffect } from 'react';
import usePdaScan from 'react-native-pda-scan';

const ShowStatus = ({ route, navigation }) => {
  useEffect(() => {
    usePdaScan({
      onEvent: (code) => {
        console.log('usePdaScan', code);
      },
      onError: (error) => {
        console.log('usePdaScan err', error);
      },
      trigger: 'always',
    });
  }, []);

  return (
    // JSX component
  );
};

export default ShowStatus;

this is the error I got

 Error: Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
1. You might have mismatching versions of React and the renderer (such as React DOM)
2. You might be breaking the Rules of Hooks
3. You might have more than one copy of React in the same app
See https://fb.me/react-invalid-hook-call for tips about how to debug and fix this problem.

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.