From c5744450124c0b804598b343df277403ca518fad Mon Sep 17 00:00:00 2001 From: SHAN Huiyang <50712413+shanhuiyang@users.noreply.github.com> Date: Wed, 15 Jan 2020 21:42:58 +0800 Subject: [PATCH] fix Can't find variable Intl #62 (#63) --- client/App.tsx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/client/App.tsx b/client/App.tsx index e8be2fe..e67aa4b 100644 --- a/client/App.tsx +++ b/client/App.tsx @@ -1,3 +1,10 @@ +// Need manually add Intl polyfill for react-native app +import "intl"; +(Intl as any).__disableRegExpRestore(); + +import "intl/locale-data/jsonp/en"; +import "intl/locale-data/jsonp/zh"; + import React from "react"; import { Root } from "native-base"; import { NativeRouter } from "react-router-native"; @@ -15,10 +22,6 @@ import { setHostUrl } from "./core/src/shared/fetch"; import { HOST_URL_DEV, HOST_URL_PROD } from "./core/src/models/HostUrl"; import * as Localization from "expo-localization"; -// You should manually add Intl polyfill for react-native app -import "intl"; -import "intl/locale-data/jsonp/en"; -import "intl/locale-data/jsonp/zh"; import { SET_LOCALE } from "./core/src/actions/common"; interface Props {}