Skip to content

Commit

Permalink
[docs] Upgrade React Native docs to 0.63.2 (#9838)
Browse files Browse the repository at this point in the history
* [docs] Upgrade unversioned React Native docs to 0.63.2

* [docs] First batch of after upgrade fixes

* [docs] Last batch of after upgrade fixes

* [docs] Update SDK 39 react native api docs with unversioned
  • Loading branch information
byCedric committed Aug 25, 2020
1 parent eb9bd27 commit 3f550d5
Show file tree
Hide file tree
Showing 100 changed files with 3,848 additions and 3,032 deletions.
45 changes: 14 additions & 31 deletions docs/pages/versions/unversioned/react-native/accessibilityinfo.md
Expand Up @@ -25,19 +25,22 @@ export default function App() {
handleScreenReaderToggled
);

AccessibilityInfo.fetch().then(reduceMotionEnabled => {
setReduceMotionEnabled(reduceMotionEnabled);
});
AccessibilityInfo.fetch().then(screenReaderEnabled => {
setScreenReaderEnabled(screenReaderEnabled);
});
AccessibilityInfo.isReduceMotionEnabled().then(
reduceMotionEnabled => {
setReduceMotionEnabled(reduceMotionEnabled);
}
);
AccessibilityInfo.isScreenReaderEnabled().then(
screenReaderEnabled => {
setScreenReaderEnabled(screenReaderEnabled);
}
);

return () => {
AccessibilityInfo.removeEventListener(
"reduceMotionChanged",
handleReduceMotionToggled
);

AccessibilityInfo.removeEventListener(
"screenReaderChanged",
handleScreenReaderToggled
Expand Down Expand Up @@ -86,59 +89,47 @@ const styles = StyleSheet.create({
### `isBoldTextEnabled()`

```js

static isBoldTextEnabled()

```

**iOS-only** Query whether a bold text is currently enabled. Returns a promise which resolves to a boolean. The result is `true` when bold text is enabled and `false` otherwise.
**iOS-Only.** Query whether a bold text is currently enabled. Returns a promise which resolves to a boolean. The result is `true` when bold text is enabled and `false` otherwise.

### `isGrayscaleEnabled()`

```js

static isGrayscaleEnabled()

```

**iOS-only** Query whether grayscale is currently enabled. Returns a promise which resolves to a boolean. The result is `true` when grayscale is enabled and `false` otherwise.
**iOS-Only.** Query whether grayscale is currently enabled. Returns a promise which resolves to a boolean. The result is `true` when grayscale is enabled and `false` otherwise.

### `isInvertColorsEnabled()`

```js

static isInvertColorsEnabled()

```

**iOS-only** Query whether invert colors is currently enabled. Returns a promise which resolves to a boolean. The result is `true` when invert colors is enabled and `false` otherwise.
**iOS-Only.** Query whether invert colors is currently enabled. Returns a promise which resolves to a boolean. The result is `true` when invert colors is enabled and `false` otherwise.

### `isReduceMotionEnabled()`

```js

static isReduceMotionEnabled()

```

Query whether reduce motion is currently enabled. Returns a promise which resolves to a boolean. The result is `true` when reduce motion is enabled and `false` otherwise.

### `isReduceTransparencyEnabled()`

```js

static isReduceTransparencyEnabled()

```

**iOS-only** Query whether reduce transparency is currently enabled. Returns a promise which resolves to a boolean. The result is `true` when a reduce transparency is enabled and `false` otherwise.
**iOS-Only.** Query whether reduce transparency is currently enabled. Returns a promise which resolves to a boolean. The result is `true` when a reduce transparency is enabled and `false` otherwise.

### `isScreenReaderEnabled()`

```js

static isScreenReaderEnabled()

```

Query whether a screen reader is currently enabled. Returns a promise which resolves to a boolean. The result is `true` when a screen reader is enabled and `false` otherwise.
Expand All @@ -148,9 +139,7 @@ Query whether a screen reader is currently enabled. Returns a promise which reso
### `addEventListener()`

```js

static addEventListener(eventName, handler)

```

Add an event handler. Supported events:
Expand All @@ -170,9 +159,7 @@ Add an event handler. Supported events:
### `setAccessibilityFocus()`

```js

static setAccessibilityFocus(reactTag)

```

Set accessibility focus to a React component. On Android, this calls `UIManager.sendAccessibilityEvent(reactTag, UIManager.AccessibilityEventTypes.typeViewFocused);`.
Expand All @@ -184,9 +171,7 @@ Set accessibility focus to a React component. On Android, this calls `UIManager.
### `announceForAccessibility()`

```js

static announceForAccessibility(announcement)

```

Post a string to be announced by the screen reader.
Expand All @@ -196,9 +181,7 @@ Post a string to be announced by the screen reader.
### `removeEventListener()`

```js

static removeEventListener(eventName, handler)

```

Remove an event handler.
30 changes: 13 additions & 17 deletions docs/pages/versions/unversioned/react-native/actionsheetios.md
Expand Up @@ -8,26 +8,26 @@ Displays native to iOS [Action Sheet](https://developer.apple.com/design/human-i
## Example

```js
import React, { useState } from "react";
import { ActionSheetIOS, Button, StyleSheet, Text, View } from "react-native";
import React, { useState } from 'react';
import { ActionSheetIOS, Button, StyleSheet, Text, View } from 'react-native';

export default function App() {
const [result, setResult] = useState("🔮");
const [result, setResult] = useState('🔮');

const onPress = () =>
ActionSheetIOS.showActionSheetWithOptions(
{
options: ["Cancel", "Generate number", "Reset"],
options: ['Cancel', 'Generate number', 'Reset'],
destructiveButtonIndex: 2,
cancelButtonIndex: 0
cancelButtonIndex: 0,
},
buttonIndex => {
if (buttonIndex === 0) {
// cancel action
} else if (buttonIndex === 1) {
setResult(Math.floor(Math.random() * 100) 1);
setResult(Math.floor(Math.random() * 100) + 1);
} else if (buttonIndex === 2) {
setResult("🔮");
setResult('🔮');
}
}
);
Expand All @@ -38,17 +38,17 @@ export default function App() {
<Button onPress={onPress} title="Show Action Sheet" />
</View>
);
};
}

const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: "center"
justifyContent: 'center',
},
result: {
fontSize: 64,
textAlign: "center"
}
textAlign: 'center',
},
});
```

Expand All @@ -59,9 +59,7 @@ const styles = StyleSheet.create({
### `showActionSheetWithOptions()`

```js

static showActionSheetWithOptions(options, callback)

```

Display an iOS action sheet. The `options` object must contain one or more of:
Expand All @@ -72,7 +70,7 @@ Display an iOS action sheet. The `options` object must contain one or more of:
- `title` (string) - a title to show above the action sheet
- `message` (string) - a message to show below the title
- `anchor` (number) - the node to which the action sheet should be anchored (used for iPad)
- `tintColor` (string) - the [color](../colors/) used for non-destructive button titles
- `tintColor` (string) - the [color](https://reactnative.dev/docs/colors) used for non-destructive button titles

The 'callback' function takes one parameter, the zero-based index of the selected item.

Expand All @@ -83,7 +81,7 @@ ActionSheetIOS.showActionSheetWithOptions(
{
options: ['Cancel', 'Remove'],
destructiveButtonIndex: 1,
cancelButtonIndex: 0
cancelButtonIndex: 0,
},
buttonIndex => {
if (buttonIndex === 1) {
Expand All @@ -98,9 +96,7 @@ ActionSheetIOS.showActionSheetWithOptions(
### `showShareActionSheetWithOptions()`

```js

static showShareActionSheetWithOptions(options, failureCallback, successCallback)

```

Display the iOS share sheet. The `options` object should contain one or both of `message` and `url` and can additionally have a `subject` or `excludedActivityTypes`:
Expand Down
70 changes: 35 additions & 35 deletions docs/pages/versions/unversioned/react-native/activityindicator.md
Expand Up @@ -8,31 +8,31 @@ Displays a circular loading indicator.
## Example

```js
import React from "react";
import { ActivityIndicator, StyleSheet, Text, View } from "react-native";

const App = () => (
<View style={[styles.container, styles.horizontal]}>
<ActivityIndicator />
<ActivityIndicator size="large" />
<ActivityIndicator size="small" color="#0000ff" />
<ActivityIndicator size="large" color="#00ff00" />
</View>
);
import React from 'react';
import { ActivityIndicator, StyleSheet, Text, View } from 'react-native';

export function App() {
return (
<View style={[styles.container, styles.horizontal]}>
<ActivityIndicator />
<ActivityIndicator size="large" />
<ActivityIndicator size="small" color="#0000ff" />
<ActivityIndicator size="large" color="#00ff00" />
</View>
);
}

const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: "center"
justifyContent: 'center',
},
horizontal: {
flexDirection: "row",
justifyContent: "space-around",
padding: 10
}
flexDirection: 'row',
justifyContent: 'space-around',
padding: 10,
},
});

export default App;
```

# Reference
Expand All @@ -45,38 +45,38 @@ Inherits [View Props](../view/#props).

### `animating`

Whether to show the indicator (`true`, the default) or hide it (`false`).
Whether to show the indicator (`true`) or hide it (`false`).

| Type | Required |
| ---- | -------- |
| bool | No |
| Type | Required | Default |
| ---- | -------- | ------- |
| bool | No | `true` |

---

### `color`

The foreground color of the spinner (default is gray on iOS and dark cyan on Android).
The foreground color of the spinner.

| Type | Required |
| --------------- | -------- |
| [color](https://reactnative.dev/docs/colors) | No |
| Type | Required | Default |
| -------------------------------------------- | -------- | ---------------------------------------------------------------------------- |
| [color](https://reactnative.dev/docs/colors) | No | `null` (system accent default color) **(Android)**<hr/>`'#999999'` **(iOS)** |

---

### `hidesWhenStopped`
### `hidesWhenStopped` **(iOS)**

Whether the indicator should hide when not animating (true by default).
Whether the indicator should hide when not animating.

| Type | Required | Platform |
| ---- | -------- | -------- |
| bool | No | iOS |
| Type | Required | Default |
| ---- | -------- | ------- |
| bool | No | `true` |

---

### `size`

Size of the indicator (default is 'small'). Passing a number to the size prop is only supported on Android.
Size of the indicator.

| Type | Required |
| ---------------------------------- | -------- |
| enum('small', 'large'), number | No |
| Type | Required | Default |
| --------------------------------------------------- | -------- | --------- |
| `enum('small', 'large')`<hr/>`number` **(Android)** | No | `'small'` |
2 changes: 0 additions & 2 deletions docs/pages/versions/unversioned/react-native/alert.md
Expand Up @@ -120,7 +120,5 @@ Alert.alert(
### `alert()`

```js

static alert(title, message?, buttons?, options?)

```

0 comments on commit 3f550d5

Please sign in to comment.