딥 링크 이슈 해결

00_8_3·2022년 6월 16일
0

딥링크

이슈 1, nacl 폴리필 문제

import nacl from "tweetnacl";

tweetnacl 라이브러리 사용 시

해결 방법

import "react-native-get-random-values"; 설치

https://github.com/ethers-io/ethers.js/issues/1118

이슈 2, URL 객체 폴리필 문제

URL, URLSearchParams 사용 시 에러

해결 방법

import "react-native-url-polyfill/auto"; 설치

https://stackoverflow.com/questions/62183745/url-pathname-or-url-searchparams-is-not-a-function-in-android-react-native

DOCS, 위 라이브러리가 왜 필요한가?

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!

출처

https://rewardingway.tistory.com/entry/React-Native-%EB%94%A5%EB%A7%81%ED%81%AC-%EC%97%B0%EA%B2%B0%ED%95%98%EA%B8%B0

0개의 댓글