react-markdown (which supports React Native nowadays) requires remark-parse which requires parse-entities, and the React Native bundler seems to pick up (for some reason) the replacement field "browser" in package.json, which throws an error because decode-entity.browser.js uses document, and that's not present in React Native.
This PR adds the replacement field "react-native" in package.json, which in the React Native bundler takes priority over "browser", to use the default decode-entity.js file. I tested this solution in an actual RN app and it works.
react-markdown
(which supports React Native nowadays) requiresremark-parse
which requiresparse-entities
, and the React Native bundler seems to pick up (for some reason) the replacement field"browser"
in package.json, which throws an error becausedecode-entity.browser.js
usesdocument
, and that's not present in React Native.This PR adds the replacement field
"react-native"
in package.json, which in the React Native bundler takes priority over"browser"
, to use the defaultdecode-entity.js
file. I tested this solution in an actual RN app and it works.