-
Notifications
You must be signed in to change notification settings - Fork 63
docs: miscellaneous section #723
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: feat/docs
Are you sure you want to change the base?
Changes from all commits
be2cc76
31ecc4e
9dc732a
d3aec98
0bc11a9
b034548
dab6c7d
c0dc699
ef5f475
584c241
5e8cd00
38a1b44
9018341
1f96627
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,77 @@ | ||||||
| --- | ||||||
| sidebar_position: 1 | ||||||
| --- | ||||||
|
|
||||||
| # Compatibility | ||||||
|
|
||||||
| This page is the single source of truth for the React Native versions the | ||||||
| library supports and for the small set of behaviours that differ between | ||||||
| platforms. | ||||||
|
|
||||||
| :::info | ||||||
|
|
||||||
| React Native Enriched HTML works **only** with the | ||||||
| [React Native New Architecture (Fabric)](https://reactnative.dev/architecture/landing-page). | ||||||
| The New Architecture is enabled by default in recent React Native versions. If | ||||||
| your app still uses the old architecture, you'll need to migrate to the New | ||||||
| Architecture before installing the library. | ||||||
|
|
||||||
| ::: | ||||||
|
|
||||||
| ## Supported React Native versions | ||||||
|
|
||||||
| The table assumes you're using the latest patch of each library minor version. | ||||||
|
|
||||||
| <EnrichedCompatibility /> | ||||||
|
|
||||||
| ## Platform differences | ||||||
|
|
||||||
| Android, iOS and Web are built on different text systems, so a few APIs | ||||||
| behave differently depending on the platform. These are platform | ||||||
| characteristics, not library bugs, and they're collected here. For limitations that affect | ||||||
| every platform, see [Known limitations](/misc/known-limitations) instead. | ||||||
|
|
||||||
| ### Justified text alignment (Android) | ||||||
|
|
||||||
| On Android, `'justify'` is accepted in the type signature but has no justified | ||||||
| layout effect - the paragraph is shown with its natural alignment, the same as | ||||||
| `'auto'`. This applies both to `setTextAlignment('justify')` and to the `justify` value reported by | ||||||
| `onChangeState`. | ||||||
|
|
||||||
| ### `ellipsizeMode` with multiple lines (Android) | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This works the same in the RN |
||||||
|
|
||||||
| On Android, when `numberOfLines` is set to a value higher than `1`, only the | ||||||
| `'tail'` value of `ellipsizeMode` works correctly. | ||||||
|
|
||||||
| ### Custom context menu (iOS 16+, ordering) | ||||||
|
|
||||||
| Custom context-menu items (`contextMenuItems`) require **iOS 16 or newer** on | ||||||
| iOS. On iOS, items appear in array order, before the system items | ||||||
| (Copy/Paste/Cut). On Android there is no guaranteed order, and custom items may | ||||||
| be shown in a submenu depending on the device manufacturer. On the Web the | ||||||
| native editing menu isn't available at all, so the prop is ignored - build your | ||||||
| own UI instead. | ||||||
|
|
||||||
| ### Return key behaviour | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here, I believe those limitations are in the RN as well. Would be good to mark it here as well |
||||||
|
|
||||||
| - **`returnKeyType`** on Android it's accepted but ignored, because | ||||||
| `returnKeyType` doesn't work with multiline inputs. On the Web it maps to the | ||||||
| browser's [`enterkeyhint`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/enterkeyhint). | ||||||
| - **`returnKeyLabel`** is supported on Android but not on iOS, and can't be set | ||||||
| inside a browser, so it's ignored on the Web. | ||||||
|
|
||||||
| ### Cursor / selection color | ||||||
|
|
||||||
| The `cursorColor` prop is applied on Android and Web. On iOS the caret and | ||||||
| selection color both follow the `selectionColor` prop. | ||||||
|
|
||||||
| ### HTML is not sanitized (Mobile) | ||||||
|
|
||||||
| On iOS and Android, the library does not sanitize HTML. It makes no guarantees that the markup it accepts or produces is safe. You are fully responsible for sanitizing any HTML you persist, render elsewhere, or accept from untrusted sources. | ||||||
|
|
||||||
| Sanitization _is_ enforced on the web, as injecting unsafe HTML directly into the DOM poses severe security risks (like XSS). | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shouldn't this be ?
Suggested change
|
||||||
|
|
||||||
| ### React Native layout ref methods | ||||||
|
|
||||||
| On Web those methods are no-ops. These include: `measure`, | ||||||
| `measureInWindow`, `measureLayout` and `setNativeProps`. | ||||||
Uh oh!
There was an error while loading. Please reload this page.