import nacl from "tweetnacl";
tweetnacl
라이브러리 사용 시
import "react-native-get-random-values";
설치
https://github.com/ethers-io/ethers.js/issues/1118
URL
, URLSearchParams
사용 시 에러
import "react-native-url-polyfill/auto";
설치
Why do we need this?
React Native does include a polyfill for URL, but this polyfill is homemade — in order to keep it light-weight — and was initially created to handle specific use cases.
Meanwhile, React Native has grown around that polyfill, then some unexpected errors have arisen.
Known issues (non-exhaustive) with React Native's URL are:
URL cannot handle "localhost" domain for base url react-native#26019.
URL implementation should add a trailing slash to the base react-native#25717.
URL incorrectly adds trailing slash react-native#24428.
Creating an instance of URL like: new URL('http://facebook.com') throws an exception react-native#16434.
Unfortunately, adding react-native-url-polyfill to React Native source code will means adding 📦 74.94 KB (as of RN 0.63) to the JavaScript bundle.
That's why you may need this external dependency. So, if you use URL within your app, you probably want to take a look at the installation steps below!