[x] Chore (a non-breaking change which is related to package maintenance)
[ ] Bug fix (a non-breaking change which fixes an issue)
[ ] New feature (a non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to change)
Description
This PR adds support for use in React Native projects by adding an explicit react-native key to package.json. It points to the ES Module bundle.
Background info
React Native's bundler (Metro) does not support .cjs files. Since Metro uses the main entry in package.json, it tries to load dist/index.cjs unsuccessfully.
Metro resolves package entry files using the following order:
react-native
browser
main
Checklist:
[ ] My change requires an update to the official documentation.
[ ] All TSDoc comments are up-to-date and new ones have been added where necessary.
Types of changes
Description
This PR adds support for use in React Native projects by adding an explicit
react-native
key topackage.json
. It points to the ES Module bundle.Background info
React Native's bundler (Metro) does not support
.cjs
files. Since Metro uses themain
entry inpackage.json
, it tries to loaddist/index.cjs
unsuccessfully.Metro resolves package entry files using the following order:
react-native
browser
main
Checklist:
⚛️