Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Usage example with hooks in a functional component please? #4

Open
ImranFromPoppins opened this issue Mar 24, 2022 · 3 comments
Open

Comments

@ImranFromPoppins
Copy link

Hello, I tried placing the sample component inside a functional react-native component but nothing happened. Can you pls give some equivalent sample of usage in functional comppnents or how to use the sample class component in a functional component pls?

Thanks!

@MBrizic01
Copy link

Hello Imran, if I understood your question correctly, this is the sample of SDK for BlinkCard . Here are also the steps of how to integrate it to your project. Let me know if you have any further questions!

@ImranFromPoppins
Copy link
Author

Hey @MBrizic01 I have setup the package in my project, I used this sample code provided here. When I place this sample component inside of a parent functional component, nothing happens when I click scan.

function Parent() {
 return(
  <div>
     <Sample />
  </div>
)
}

However, when I make the Sample component a separate screen, it works fine.

I even tried refactoring the above same code to use in Func Comp but it didnt work, and didn't give any errors.

So, I was looking for some code examples of usage using hooks and functional components.

The setup of the package is good, I am only finding issues with the usage docs.

@MBrizic01
Copy link

Hello @ImranFromPoppins, can you please tell me what would you like to achieve? If you want to reuse our built-in activity UX inside your own activity, that is not possible for React Native. In order to achieve it, you would need to do it via native platform and then wrap it to be used for RN. Let me know if this helps!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants