Installation
eo-locale can be used in React, Preact, and React Native
You can install the package with NPM or Yarn.
Note: React 16.8+ is required for Hooks.
React#
with NPM#
with Yarn#
Preact#
with NPM#
with Yarn#
React Native#
with NPM#
with Yarn#
Setting up#
React Native has "JavaScript Core" (JSC) to run JavaScript codes in Android.
By default, the JSC does not support libraries that manage internationalization.
To use eo-locale, you need to change new JSC distribution and rebuild your project.
In React Native 0.60 or newer#
Change value of jscFlavor in file android/app/build.gradle to org.webkit:android-jsc-intl:+.
And rebuild your project, then you can use eo-locale everywhere in your application!
In React Native 0.59#
First, you need to install an NPM dependency named jsc-android by adding it to the dependencies section in your package.json,
and run npm install or yarn install.
(X and Y is a minor and patch version. Check on the JSC repository)
Update 3 sections in file android/app/build.gradle.
dependenciesAdd
implementation "org.webkit:android-jsc-intl:r241213"at first of the section.androidAdd
packagingOptionsto this section as follow:jscFlavorChange
jscFlavortoorg.webkit:android-jsc-intl:+.
In React Native 0.58 or below#
You can find this information on the JSC repository.
Usage#
You can see how to use all available components in the Components section.