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

Does this library support react-native? #338

Open
QMY-ZQ opened this issue May 22, 2024 · 4 comments
Open

Does this library support react-native? #338

QMY-ZQ opened this issue May 22, 2024 · 4 comments

Comments

@QMY-ZQ
Copy link

QMY-ZQ commented May 22, 2024

I tried installing this library and the same problem occurred,Is there any solution?https://github.com/metafloor/bwip-js/issues/296

@metafloor
Copy link
Owner

This project should support react-native. You likely need to enable export maps support in your project - it is the modern multi-platform packaging solution.

@QMY-ZQ
Copy link
Author

QMY-ZQ commented May 28, 2024

This project should support react-native. You likely need to enable export maps support in your project - it is the modern multi-platform packaging solution.

So, do you have any guidance?

@ArturBuja
Copy link

ArturBuja commented Jul 4, 2024

This project should support react-native. You likely need to enable export maps support in your project - it is the modern multi-platform packaging solution.

So, do you have any guidance?

https://www.npmjs.com/package/bwip-js Here, You have docs about RN. You'll need also a
"react-zlib-js"; lib to make bwip works. Then U'll need use useState with useEffect for fetch code from bwipjs.toDataURL in async/await function then You can use Image from React Native to displey the code. This is big short but maybe it will tell you something

@metafloor
Copy link
Owner

metafloor commented Jul 4, 2024

Yesterday, new platform specific packages were released, one of which specifically targets react-native. Please try:

npm install @bwip-js/react-native

The import will then be structured as:

import bwipjs from "@bwip-js/react-native";
   // or to allow tree shaking by the bundler
import { qrcode, code128 } from "@bwip-js/react-native";

For the react-native install, the react-zlib-js library is listed as a dependency, so it should install automatically.

If you have any issues with using the platform-specific library, please let me know.

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

3 participants