Skip to content
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

[pull] master from facebook:master #15

Merged
merged 49 commits into from
Oct 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
604174b
Update introduction.md (#2181)
aeorge Aug 30, 2020
b1e5983
adding snack player instead of images for flexbox (#2171)
Stringsaeed Aug 30, 2020
0749856
UI & UX Design with InputAccessoryView (#2183)
mojvan Aug 30, 2020
5a72cc4
update TextInput example, refs #2187
Simek Sep 1, 2020
f32d2ba
add TOC and improve formatting on the Android publishing page
Simek Sep 1, 2020
a781893
Modernize code examples in the direct manipulation section (#2189)
steveluscher Sep 1, 2020
5dad099
update Alert API page, include iOS specific functions from deprecated…
Simek Sep 2, 2020
1027b15
Update getting-started.md (#2194)
prkhandelwal Sep 2, 2020
52e44de
fix homepage showcase app list graphical issue (#2185)
Simek Sep 2, 2020
12a3ef8
docs: add matrix to transform (#2197)
Naturalclar Sep 6, 2020
8359f8c
Bump decompress from 4.2.0 to 4.2.1 in /website (#2200)
dependabot[bot] Sep 6, 2020
8619413
Typo fix (#2202)
joebernard Sep 6, 2020
4ec58c6
fixes #2201, delete duplicated TOC, add note about removal to TabBarI…
Simek Sep 6, 2020
becc1ad
docs: update deprecated usage of findNodeHandle in measureLayout (#2199)
Titozzz Sep 6, 2020
4209961
bump alex and node-fetch, fix new alex warning
Simek Sep 6, 2020
cc2197e
typo fix
Simek Sep 7, 2020
fd8a053
TextInput: Add `onPressIn` and `onPressOut` docs (#2205)
ecreeth Sep 8, 2020
ec52109
Fix typos (#2204)
p13i Sep 9, 2020
3256ad4
link out-of-tree platforms, add macOS platform, unify dashes on homep…
Simek Sep 10, 2020
347ba70
update SectionList page, extract ViewToken, add labels (#2191)
Simek Sep 10, 2020
7d2d912
update TextInput press callbacks type, refs #2205
Simek Sep 10, 2020
fadb0f1
Added workarounds for TextInputs (#2203)
EyMaddis Sep 10, 2020
e178497
update Text page and add types, add LayoutEvent object page (#2209)
Simek Sep 11, 2020
faec4ee
Incorrect command (#2207)
nfort Sep 11, 2020
48fa21d
Updated ScrollView `disableIntervalMomentum` doc. (#2211)
Ashwin-Mothilal Sep 13, 2020
aa6bca5
Remove announcement banner. (#2213)
cpojer Sep 16, 2020
f923158
Docs: Removing `onTextInput` prop from TextInput (#2216)
Ashwin-Mothilal Sep 18, 2020
0ebaaf4
Signing not under General for me (#2214)
captDaylight Sep 18, 2020
3770032
Update running-on-simulator-ios.md (#2220)
ppichier Sep 23, 2020
f5b9422
[DOC] fixed errata in image doc (#2221)
ovarunendra Sep 23, 2020
8e37222
Add documentation for Hermes sampling profiler (#2159)
jessieAnhNguyen Sep 24, 2020
b158da2
Adding Android NDK Installation Guide (#2225)
gedeagas Sep 29, 2020
e9b35bb
Docs: Integration with android fragment (#2217)
svnm Sep 29, 2020
1ab78b4
Add new option to ActionSheetIOS called disabledButtonsIndices (#1898)
lukewalczak Sep 29, 2020
3e5b9e4
Adding configureNext.onAnimationDidFail callback on LayoutAnimation (…
gedeagas Sep 29, 2020
b831490
Added Coinbase to showcase (#2227)
jlin27 Sep 29, 2020
2c11509
0.63.3 release - update Pressable delay (#2226)
Simek Sep 30, 2020
a8f97e6
Improved README.md (#2233)
vishalvishw10 Oct 1, 2020
37026d7
fix typo (#2232)
adamrhunter Oct 1, 2020
814af08
Add Shopify and Tableau to showcase (#2228)
Oct 1, 2020
dc8ce76
updated debugging.md (#2241)
Ashish1101 Oct 3, 2020
7d06a82
Update appregistry.md (#2246)
sunnylqm Oct 5, 2020
45e8202
Update out-of-tree-platforms.md (#2243)
asklar Oct 5, 2020
309d955
Remove unnecessary python dependency (#2250)
sunnylqm Oct 7, 2020
ab9c262
Update network.md to show android non ssl block (#2245)
s-maurice Oct 7, 2020
c67e3c0
remove link in native-modules-ios (#2244)
luism3861 Oct 7, 2020
41ec669
Update textinput.md (#2249)
ralph-dev Oct 8, 2020
f9ff51d
Merge branch 'master' into master
Simek Oct 9, 2020
467706b
revert change to Netlify config due to V2 test merge
Simek Oct 9, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ As mentioned above, the `docs` folder contains the source files for all of the d

### Versioned docs

The React Native website is versioned as to allow users to go back and see the API reference docs for any given release. A new version of the website is generally generated whenever there is a new React Native release. When this happens, any changes made to the `docs` and `website/sidebars.json` files will be copied over to the corresponding location within `website/versioned_docs` and `website/versioned_sidebars`.
The React Native website is versioned to allow users to go back and see the API reference docs for any given release. A new version of the website is generally generated whenever there is a new React Native release. When this happens, any changes made to the `docs` and `website/sidebars.json` files will be copied over to the corresponding location within `website/versioned_docs` and `website/versioned_sidebars`.

> **_Note:_** Do not edit the auto-generated files within `versioned_docs` or `versioned_sidebars` unless you are sure it is necessary. Edits made to older versions will not be propagated to newer versions of the docs.

Expand Down Expand Up @@ -116,7 +116,7 @@ The `showcase.json` file contains the list of users that are highlighted in the
1. Follow the "[Running locally](#running-locally)" instructions.
1. Save the files and check in the browser.
1. Some changes may require a server restart to generate new files. (Pages in `docs` always do!)
1. Edits to pages in `docs` will only be visible in the latest version of the documentation, called "Next", located under `docs/next` path.
1. Edits to pages in `docs` will only be visible in the latest version of the documentation, called "Next", located under the `docs/next` path.

Visit **http://localhost:3000/docs/next/YOUR-DOCS-PAGE** to see your work.

Expand All @@ -126,7 +126,7 @@ Visit **http://localhost:3000/docs/next/YOUR-DOCS-PAGE** to see your work.

If possible, test any visual changes in all latest versions of the following browsers:

- Chrome and Firefox on desktop.
- Chrome and Firefox on the desktop.
- Chrome and Safari on mobile.

### Push it
Expand Down
1 change: 1 addition & 0 deletions docs/actionsheetios.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ Display an iOS action sheet. The `options` object must contain one or more of:
- `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
- `disabledButtonIndices` (array of numbers) - a list of button indices which should be disabled

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

Expand Down
164 changes: 137 additions & 27 deletions docs/alert.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ Launches an alert dialog with the specified title and message.

Optionally provide a list of buttons. Tapping any button will fire the respective onPress callback and dismiss the alert. By default, the only button will be an 'OK' button.

This is an API that works both on Android and iOS and can show static alerts. To show an alert that prompts the user to enter some information, see `AlertIOS`; entering text in an alert is common on iOS only.
This is an API that works both on Android and iOS and can show static alerts. Alert that prompts the user to enter some information is avaiable on iOS only.

### Example
## Example

<div class="toggler">
<ul role="tablist" class="toggle-syntax">
Expand Down Expand Up @@ -149,7 +149,7 @@ export default App;

## iOS

On iOS you can specify any number of buttons. Each button can optionally specify a style, which is one of 'default', 'cancel', or 'destructive'.
On iOS you can specify any number of buttons. Each button can optionally specify a style, avaiable options are represented by the [AlertButtonStyle](#alertbuttonstyle) enum.

## Android

Expand All @@ -159,33 +159,41 @@ On Android at most three buttons can be specified. Android has a concept of a ne
- Two buttons mean 'negative', 'positive' (such as 'Cancel', 'OK')
- Three buttons mean 'neutral', 'negative', 'positive' (such as 'Later', 'Cancel', 'OK')

Alerts on Android can be dismissed by tapping outside of the alert box. It is disabled by default and can be enabled by providing an optional `options` parameter with the cancelable property set to true i.e. `{ cancelable: true }`.
Alerts on Android can be dismissed by tapping outside of the alert box. It is disabled by default and can be enabled by providing an optional [Options](alert#options) parameter with the cancelable property set to `true` i.e.<br/>`{ cancelable: true }`.

The cancel event can be handled by providing an `onDismiss` callback property `{ onDismiss: () => {} }` inside the `options` parameter.
The cancel event can be handled by providing an `onDismiss` callback property inside the `options` parameter.

Example usage:
### Example <div class="label android">Android</div>

```jsx
Alert.alert('Alert Title', 'My Alert Msg', [
{
text: 'Ask me later',
onPress: () => console.log('Ask me later pressed')
},
{
text: 'Cancel',
onPress: () => console.log('Cancel Pressed'),
style: 'cancel'
},
{ text: 'OK', onPress: () => console.log('OK Pressed') },
{
// cancelable and onDismiss only work on Android.
cancelable: true,
onDismiss: () =>
console.log(
'This alert was dismissed by tapping outside of the alert dialog.'
)
}
]);
```SnackPlayer name=Alert%20Android%20Dissmissable%20Example&supportedPlatforms=android
import React from "react";
import { View, StyleSheet, Button, Alert } from "react-native";

const showAlert = () =>
Alert.alert(
"Alert Title",
"My Alert Msg",
[
{
text: "Cancel",
onPress: () => Alert.alert("Cancel Pressed"),
style: "cancel",
},
],
{
cancelable: true,
onDismiss: () =>
Alert.alert(
"This alert was dismissed by tapping outside of the alert dialog."
),
}
);

const App = () => (
<Button title="Show alert" onPress={showAlert} />
);

export default App;
```

---
Expand All @@ -199,3 +207,105 @@ Alert.alert('Alert Title', 'My Alert Msg', [
```jsx
static alert(title, message?, buttons?, options?)
```

**Parameters:**

| Name | Type | Description |
| ------- | ----------------------------------------------------------------- | ----------------------------------------------------------------------- |
| title | string <div class="label basic required">Required</div> | The dialog's title. Passing `null` or empty string will hide the title. |
| message | string | An optional message that appears below the dialog's title. |
| buttons | [Buttons](alert#buttons) | An optional array containg buttons configuration. |
| options | [Options](alert#options) <div class="label android">Android</div> | An optional Alert configuration for the Android. |

---

### `prompt()` <div class="label ios">iOS</div>

```jsx
static prompt(title, message?, callbackOrButtons?, type?, defaultValue?, keyboardType?)
```

Create and display a prompt to enter some text in form of Alert.

**Parameters:**

| Name | Type | Description |
| ----------------- | ------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| title | string <div class="label basic required">Required</div> | The dialog's title. |
| message | string | An optional message that appears above the text input. |
| callbackOrButtons | function<hr/>[Buttons](alert#buttons) | If passed a function, it will be called with the prompt's value<br/>`(text: string) => void`, when the user taps 'OK'.<hr/>If passed an array, buttons will be configured based on the array content. |
| type | [AlertType](alert#alerttype) | This configures the text input. |
| defaultValue | string | The default text in text input. |
| keyboardType | string | The keyboard type of first text field (if exists). One of TextInput [keyboardTypes](textinput#keyboardtype). |

---

## Type Definitions

### AlertButtonStyle <div class="label ios">iOS</div>

An iOS Alert button style.

| Type |
| ---- |
| enum |

**Constants:**

| Value | Description |
| --------------- | ------------------------- |
| `'default'` | Default button style. |
| `'cancel'` | Cancel button style. |
| `'destructive'` | Destructive button style. |

---

### AlertType <div class="label ios">iOS</div>

An iOS Alert type.

| Type |
| ---- |
| enum |

**Constants:**

| Value | Description |
| ------------------ | ---------------------------- |
| `'default'` | Default alert with no inputs |
| `'plain-text'` | Plain text input alert |
| `'secure-text'` | Secure text input alert |
| `'login-password'` | Login and password alert |

---

### Buttons

Array of objects containg Alert buttons configuration.

| Type |
| ---------------- |
| array of objects |

**Objects properties:**

| Name | Type | Description |
| -------------------------------------- | ------------------------------------------ | ------------------------------------------------------- |
| text | string | Button label. |
| onPress | function | Callback function when button is pressed. |
| style <div class="label ios">iOS</div> | [AlertButtonStyle](alert#alertbuttonstyle) | Button style, on Android this property will be ignored. |

---

### Options <div class="label android">Android</div>

| Type |
| ------ |
| object |

**Properties:**

| Name | Type | Description |
| ---------- | -------- | ---------------------------------------------------------------------- |
| cancelable | boolean | Defines if alert can be dismissed by tapping outside of the alert box. |
| onDismiss | function | Callback function fired when alert has been dismissed. |
2 changes: 1 addition & 1 deletion docs/appregistry.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Only called from native code. Cancels a headless task.

**Parameters:**

| Name | Type | Required |
| Name | Type | Description |
| -------------------------------------------------------- | ------ | --------------------------------------------------------------------------------------- |
| taskId <div class="label basic required">Required</div> | number | The native id for this task instance that was used when `startHeadlessTask` was called. |
| taskKey <div class="label basic required">Required</div> | string | The key for the task that was used when `startHeadlessTask` was called. |
Expand Down
6 changes: 5 additions & 1 deletion docs/building-for-tv.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,4 +155,8 @@ class Game2048 extends React.Component {

- _Known issues_:

- `TextInput` components do not work for now (i.e. they cannot receive focus, see [this comment](https://github.com/facebook/react-native/pull/16500#issuecomment-629285638)).
- `TextInput` components do not work for now (i.e. they cannot receive focus automatically, see [this comment](https://github.com/facebook/react-native/pull/16500#issuecomment-629285638)).
- It is however possible to use a ref to manually trigger `inputRef.current.focus()`.
- You can wrap your input inside a `TouchableWithoutFeedback` component and trigger focus in the `onFocus` event of that touchable. This enables opening the keyboard via the arrow keys.
- The keyboard might reset its state after each keypress (this might only happen inside the Android TV emulator).
- The content of `Modal` components cannot receive focus, see [this issue](https://github.com/facebook/react-native/issues/24448) for details.
2 changes: 1 addition & 1 deletion docs/debugging.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ LogBox.ignoreAllLogs();

### Unhandled Errors

Unhanded JavaScript errors such as `undefined is not a function` will automatically open a full screen LogBox error with the source of the error. These errors are dismissable and minimizable so that you can see the state of your app when these errors occur, but should always be addressed.
Unhandled JavaScript errors such as `undefined is not a function` will automatically open a full screen LogBox error with the source of the error. These errors are dismissable and minimizable so that you can see the state of your app when these errors occur, but should always be addressed.

### Syntax Errors

Expand Down
Loading