Skip to content

Commit

Permalink
docs: fix small typos in ViewStyle, ViewToken, Text docs (#4237)
Browse files Browse the repository at this point in the history
  • Loading branch information
sorenfrederiksen authored Sep 30, 2024
1 parent af0a5ab commit 2bf4b60
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions docs/text.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export default TextInANest;

## Nested text

Both Android and iOS allow you to display formatted text by annotating ranges of a string with specific formatting like bold or colored text (`NSAttributedString` on iOS, `SpannableString` on Android). In practice, this is very tedious. For React Native, we decided to use web paradigm for this where you can nest text to achieve the same effect.
Both Android and iOS allow you to display formatted text by annotating ranges of a string with specific formatting like bold or colored text (`NSAttributedString` on iOS, `SpannableString` on Android). In practice, this is very tedious. For React Native, we decided to use the web paradigm for this, where you can nest text to achieve the same effect.

```SnackPlayer name=Nested%20Text%20Example
import React from 'react';
Expand Down Expand Up @@ -106,7 +106,7 @@ The `<Text>` element is unique relative to layout: everything inside is no longe
<Text>First part and </Text>
<Text>second part</Text>
</Text>
// Text container: the text will be inline if the space allowed it
// Text container: the text will be inline, if the space allows it
// |First part and second part|

// otherwise, the text will flow as if it was one
Expand Down Expand Up @@ -181,7 +181,7 @@ const MyAppHeaderText = ({children}) => {
};
```

Composing `MyAppText` in this way ensures that we get the styles from a top-level component, but leaves us the ability to add / override them in specific use cases.
Composing `MyAppText` in this way ensures that we get the styles from a top-level component, but leaves us the ability to add/override them in specific use cases.

React Native still has the concept of style inheritance, but limited to text subtrees. In this case, the second part will be both bold and red.

Expand Down Expand Up @@ -254,7 +254,7 @@ On Android, these roles have similar functionality on TalkBack as adding Accessi

Tells the screen reader to treat the currently focused on element as being in a specific state.

You can provide one state, no state, or multiple states. The states must be passed in through an object. Ex: `{selected: true, disabled: true}`.
You can provide one state, no state, or multiple states. The states must be passed in through an object, e.g. `{selected: true, disabled: true}`.

| Type |
| ------------------------------------------------------ |
Expand Down
6 changes: 3 additions & 3 deletions docs/view-style-props.md
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,6 @@ Controls whether the `View` can be the target of touch events.
- `'box-none'`: The View is never the target of touch events but its subviews can be.
- `'box-only'`: The view can be the target of touch events but its subviews cannot be.

| Type |
| --------------------------------------------- |
| enum('auto', 'box-none', 'box-only', 'none' ) |
| Type |
| ----------------------------------------------------- |
| enum(`'auto'`, `'box-none'`, `'box-only'`, `'none'` ) |
4 changes: 2 additions & 2 deletions docs/viewtoken.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ id: viewtoken
title: ViewToken Object Type
---

`ViewToken` object is returned as one of properties in the `onViewableItemsChanged` callback, for example in [FlatList](flatlist) component. It is exported by [`ViewabilityHelper.js`](https://github.com/facebook/react-native/blob/main/packages/react-native/Libraries/Lists/ViewabilityHelper.js).
`ViewToken` object is returned as one of the properties in the `onViewableItemsChanged` callback (for example, in the [FlatList](flatlist) component). It is exported by [`ViewabilityHelper.js`](https://github.com/facebook/react-native/blob/main/packages/react-native/Libraries/Lists/ViewabilityHelper.js).

## Example

Expand Down Expand Up @@ -44,7 +44,7 @@ Item data

### `key`

Key identifier assigned of the data element extracted to the top level.
Key identifier assigned to the data element extracted to the top level.

| Type | Optional |
| ------ | -------- |
Expand Down

0 comments on commit 2bf4b60

Please sign in to comment.