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

Add support for react-native #157

Open
steida opened this issue Mar 16, 2025 · 2 comments
Open

Add support for react-native #157

steida opened this issue Mar 16, 2025 · 2 comments

Comments

@steida
Copy link

steida commented Mar 16, 2025

This fixes msgpackr usage in react-native

diff --git a/package.json b/package.json
index 9216a6e3cb7bd14e9c2c57f579634cbfcb117c23..2b56a98ba0fd90faaf414139767a212872dda265 100644
--- a/package.json
+++ b/package.json
@@ -7,6 +7,7 @@
   "types": "./index.d.ts",
   "main": "./dist/node.cjs",
   "module": "./index.js",
+  "react-native": "./index.js",
   "keywords": [
     "MessagePack",
     "msgpack",
@kriszyp
Copy link
Owner

kriszyp commented Mar 16, 2025

Is there some documentation explains this (react native doesn't use the standard entry point specification?)?

@steida
Copy link
Author

steida commented Mar 17, 2025

This is how I fixed msgpackr for RN. It wasn't working so there is no chance you will break anything :-) Metro docs. I think this is
a fix for CJS, but if you decide to support only ESM, then you will need this: ai/nanoid#468 (comment)

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