Skip to content

Commit

Permalink
Update docs on react native android support (#1367)
Browse files Browse the repository at this point in the history
Resolves #864
  • Loading branch information
ramijarrar authored Mar 4, 2023
1 parent c9f75ec commit 304bddc
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
11 changes: 10 additions & 1 deletion docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,13 @@ npm install --save-dev @types/luxon

## React Native

React Native works just fine, but React Native for Android doesn't ship with Intl support, which you need for [a lot of Luxon's functionality](matrix.md). Use [jsc-android-buildscripts](https://github.com/SoftwareMansion/jsc-android-buildscripts) to fix it.
React Native >=0.70 works just fine out of the box. Older versions of React Native for Android (or if you disable Hermes) doesn't include Intl support by default, which you need for [a lot of Luxon's functionality](matrix.md).

For React Native >=0.60, you should configure the build flavor of jsc in `android/app/build.gradle`:

```diff
-def jscFlavor = 'org.webkit:android-jsc:+'
+def jscFlavor = 'org.webkit:android-jsc-intl:+'
```

For even older versions of React Native you can use [jsc-android-buildscripts](https://github.com/SoftwareMansion/jsc-android-buildscripts) to fix it.
9 changes: 8 additions & 1 deletion docs/matrix.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,11 @@ Info.features(); //=> { relative: false }

Specific notes on other platforms:

- **React Native on (specifically) Android** doesn't come with Intl support, so all the possible-to-be-missing capabilities above are unavailable. Use [jsc-android-buildscripts](https://github.com/SoftwareMansion/jsc-android-buildscripts) to fix it.
- **React Native <0.70 on (specifically) Android** doesn't include Intl support by default, so all the possible-to-be-missing capabilities above are unavailable. To fix this on React Native >=0.60, you should configure the build flavor of jsc in `android/app/build.gradle`:

```diff
-def jscFlavor = 'org.webkit:android-jsc:+'
+def jscFlavor = 'org.webkit:android-jsc-intl:+'
```

For even older versions of React Native you can use [jsc-android-buildscripts](https://github.com/SoftwareMansion/jsc-android-buildscripts) to fix it.

0 comments on commit 304bddc

Please sign in to comment.