Buy Now and unlock this series
$
39
.99
$
29
.99
yours forever
$
39
.99
$
29
.99
Become a Pro and unlock everything
$
24
.99
per month
$
24
.99
Native Base For Native Styles
Downloads
Become a pro to download code and videos
React Native For Everyone
18 videos
Course Instructor
Scott Tolinski
- React Native For Everyone
1M25S - Create React Native App & Setup
6M51S - iOS Setup & Simulator
6M9S - Android Setup & Emulation
12M39S - Understanding React Native & React
12M34S - Styles In React Native
8M50S - Flexbox In React Native
11M50S - Built In Components - Working With TextInput
7M2S - Controlled Inputs
11M55S - Manipulating Data In Realtime
11M37S - Changing Tip Values With Buttons & Custom Tips
15M13S - Native Base For Native Styles
15M44S - Platform Specific Code
12M23S - Code Cleanup & React Native APIs
14M26S - Functional Stateless Components & Styling
24M21S - Building App For the Play & App Store
13M33S - Ejecting From Expo
4M46S - Where To Go From Here
3M7S
Comments
Grant
over 3 years ago [edited]
If you're getting errors in your Android emulator like "ReferenceError: Can't find variable: Intl", or "ReferenceError: No locale data has been provided for this object yet.", that's because the JavaScriptCore engine bundled with react-native for Android isn't providing "Intl" as a global var, nor populating the available locales. iOS handles "Intl" without issue because it has its own JavaScriptCore right out of the box.
In order to make this work on Android, you'll need to both install the "Intl" polyfill, and import the locales you want from the same package.
This should resolve any Intl-related issues you may have in Android!
For bonus points, you may choose to only import Intl and locale data for platforms which don't already include it. Since you cannot use Platform.OS to dynamically load imported dependencies, the only option may be to use separate files with the appropriate ".ios.js" and ".android.js", which is not ideal.
Alternatively, you might choose to bundle a newer JSC with your Android application using https://github.com/react-native-community/jsc-android-buildscripts. Read more at AirBnb's engineering blog: https://medium.com/airbnb-engineering/react-native-at-airbnb-the-technology-dafd0b43838.
Want to join the conversation?
Become a Pro member today!