-
Notifications
You must be signed in to change notification settings - Fork 64
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
Merged
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
be2cc76
feat: wip
hejsztynx 31ecc4e
feat: remove irrelevant content
hejsztynx 9dc732a
docs: add react native compatibility table
kacperzolkiewski d3aec98
docs: add comparison with other libraries
kacperzolkiewski 0bc11a9
fix: review changes
kacperzolkiewski b034548
Update docs/docs/misc/compatibility.mdx
hejsztynx dab6c7d
docs: acknowledge exampe-web app
hejsztynx c0dc699
docs: unnecessary rn new arch note
hejsztynx ef5f475
docs: link swm
hejsztynx 584c241
fix: library description
kacperzolkiewski 5e8cd00
Merge branch 'feat/docs' into @ksienkiewicz/docs-misc
hejsztynx 38a1b44
Update docs/docs/misc/compatibility.mdx
kacperzolkiewski 9018341
Update docs/docs/misc/compatibility.mdx
kacperzolkiewski 1f96627
fix: remove drag and drop
kacperzolkiewski c9c515b
Update docs/docs/misc/contributing.md
kacperzolkiewski 7b8e90c
Update docs/docs/misc/compatibility.mdx
kacperzolkiewski 9b4b4fd
Update docs/docs/misc/contributing.md
kacperzolkiewski 087c5ef
fix: review changes
kacperzolkiewski a432c51
Update docs/src/components/Compatibility/EnrichedCompatibility.tsx
kacperzolkiewski c501c31
Update docs/docs/misc/contributing.md
kacperzolkiewski File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,88 @@ | ||
| --- | ||
| 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) | ||
|
kacperzolkiewski marked this conversation as resolved.
|
||
|
|
||
| On Android, when `numberOfLines` is set to a value higher than `1`, only the | ||
| `'tail'` value of `ellipsizeMode` works correctly. This matches React Native's | ||
| built-in [`Text`](https://reactnative.dev/docs/text#ellipsizemode) component - it | ||
| is an Android platform limitation, not something specific to this library. | ||
|
|
||
| ### 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 | ||
|
kacperzolkiewski marked this conversation as resolved.
|
||
|
|
||
| These props follow the same platform rules as React Native's | ||
| [`TextInput`](https://reactnative.dev/docs/textinput): | ||
|
|
||
| - **`returnKeyType`** - behaves like on [`TextInput`](https://reactnative.dev/docs/textinput#returnkeytype) | ||
| on iOS. On Android it is accepted but has no effect, because the input is always | ||
| multiline and Android does not apply `returnKeyType` to multiline inputs - the | ||
| same long-standing behaviour as [`TextInput`](https://reactnative.dev/docs/textinput) | ||
| with `multiline={true}`. On the Web it maps to the browser's | ||
| [`enterkeyhint`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/enterkeyhint). | ||
| - **`returnKeyLabel`** - Android only, matching | ||
| [`returnKeyLabel`](https://reactnative.dev/docs/textinput#returnkeylabel-android) | ||
| on `TextInput`, where React Native recommends using it instead of | ||
| `returnKeyType`. Not available on iOS, and can't be set inside a browser, so | ||
| it is 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). | ||
|
|
||
| ### React Native layout ref methods | ||
|
|
||
| On Web those methods are no-ops. These include: `measure`, | ||
| `measureInWindow`, `measureLayout` and `setNativeProps`. | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.