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 upReact 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 newerChange 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.59First, 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
.
dependencies
Add
implementation "org.webkit:android-jsc-intl:r241213"
at first of the section.android
Add
packagingOptions
to this section as follow:jscFlavor
Change
jscFlavor
toorg.webkit:android-jsc-intl:+
.
#
In React Native 0.58 or belowYou can find this information on the JSC repository.
#
UsageYou can see how to use all available components in the Components section.