Skip to content

Commit

Permalink
[pull] master from facebook:master (#15)
Browse files Browse the repository at this point in the history
* Update introduction.md (facebook#2181)

Hooks were introduced in React Native 0.59, not 0.58.

* adding snack player instead of images for flexbox (facebook#2171)

* adding snack player instead of images for flexbox

* chore: revert yarn.lock

* minor changes and improvements, prettier run on examples

Co-authored-by: Bartosz Kaszubowski <gosimek@gmail.com>

* UI & UX Design with InputAccessoryView (facebook#2183)

* UI Design with InputAccessoryView 

* Update inputaccessoryview.md

* small tweaks

Co-authored-by: Bartosz Kaszubowski <gosimek@gmail.com>

* update TextInput example, refs facebook#2187

* add TOC and improve formatting on the Android publishing page

* Modernize code examples in the direct manipulation section (facebook#2189)

* Modernize code examples in the direct manipulation section.

* small code tweaks/fixes + run code through Prettier

Co-authored-by: Bartosz Kaszubowski <gosimek@gmail.com>

* update Alert API page, include iOS specific functions from deprecated AlertIOS (facebook#2184)

Thanks for this one, @Simek!

* Update getting-started.md (facebook#2194)

Python2 & Python3 are both compatible

* fix homepage showcase app list graphical issue (facebook#2185)

Co-authored-by: R Nabors <rachelnabors@users.noreply.github.com>

* docs: add matrix to transform (facebook#2197)

* Bump decompress from 4.2.0 to 4.2.1 in /website (facebook#2200)

Bumps [decompress](https://github.com/kevva/decompress) from 4.2.0 to 4.2.1.
- [Release notes](https://github.com/kevva/decompress/releases)
- [Commits](kevva/decompress@v4.2.0...v4.2.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Typo fix (facebook#2202)

* fixes facebook#2201, delete duplicated TOC, add note about removal to TabBarIOS pages

* docs: update deprecated usage of findNodeHandle in measureLayout (facebook#2199)

* docs: update deprecated usage of findNodeHandle in measureLayout

* minor text and Snack tweaks, prettier run

Co-authored-by: Bartosz Kaszubowski <gosimek@gmail.com>

* bump alex and node-fetch, fix new alex warning

* typo fix

* TextInput: Add `onPressIn` and `onPressOut` docs (facebook#2205)

Original summary by @yungsters in [1b994f9](facebook/react-native@b7b0e23):
Introduces support for `onPressIn` and `onPressOut` on the `TextInput` component.

This makes it possible to add visual feedback when users touch interact with `TextInput` components.

* Fix typos (facebook#2204)

* link out-of-tree platforms, add macOS platform, unify dashes on homepage (facebook#2186)

* link out-of-tree platforms, add macOS, unify dashes on homepage

* revert dashes changes

* update SectionList page, extract ViewToken, add labels (facebook#2191)

* update TextInput press callbacks type, refs facebook#2205

* Added workarounds for TextInputs (facebook#2203)

* Added workarounds for TextInputs

* provide info on the focus management using <Modal>

* small text tweaks

Co-authored-by: Bartosz Kaszubowski <gosimek@gmail.com>

* update Text page and add types, add LayoutEvent object page (facebook#2209)

* Incorrect command (facebook#2207)

https://github.com/react-native-community/cli/blob/master/docs/commands.md#run-android

`--variant [string]`

* Updated ScrollView `disableIntervalMomentum` doc. (facebook#2211)

* Remove announcement banner. (facebook#2213)

* Docs: Removing `onTextInput` prop from TextInput (facebook#2216)

* Removing `onTextInput` prop from TextInput doc.

* Removing `onTextInput` prop from TextInput on version 0.62 & 0.63.

* Signing not under General for me (facebook#2214)

* Update running-on-simulator-ios.md (facebook#2220)

We have to specify the generation for the iPhone SE simulator.

* [DOC] fixed errata in image doc (facebook#2221)

* Add documentation for Hermes sampling profiler (facebook#2159)

Co-authored-by: Saphal Patro <31125345+saphal1998@users.noreply.github.com>
Co-authored-by: R Nabors <rachelnabors@users.noreply.github.com>
Co-authored-by: Saphal Patro <saphal1998@gmail.com>

* Adding Android NDK Installation Guide (facebook#2225)

* Docs: Integration with android fragment (facebook#2217)

Co-authored-by: Sebastien Bailouni <sbailouni@gmail.com>

* Add new option to ActionSheetIOS called disabledButtonsIndices (facebook#1898)

* Adding configureNext.onAnimationDidFail callback on LayoutAnimation (facebook#2136)

Co-authored-by: Christoph Nakazawa <cpojer@fb.com>

* Added Coinbase to showcase (facebook#2227)

* Added Coinbase to showcase

* Add Coinbase icon

* 0.63.3 release - update Pressable delay (facebook#2226)

* Improved README.md (facebook#2233)

* fix typo (facebook#2232)

* fix typo

fixes typo in "Using Custom Path Aliases with TypeScript" section (configure -> configuring)

* sentence rewrite

Co-authored-by: Bartosz Kaszubowski <gosimek@gmail.com>

* Add Shopify and Tableau to showcase (facebook#2228)

* Add Shopify in showcase

* Add Shopify icon

* Add Tableau to showcase

* Add tableau image asset

* Update Tableau icon

* updated debugging.md (facebook#2241)

fixed a typo in unhandled error

* Update appregistry.md (facebook#2246)

* Update out-of-tree-platforms.md (facebook#2243)

* Remove unnecessary python dependency (facebook#2250)

Python is not required anymore on windows platform. The only binary addon for react-native project are some deps of `ws`, [which now have prebuilt binary and are optional](https://github.com/websockets/ws#opt-in-for-performance-and-spec-compliance). 
Tested on a brand new windows 10 image with only node installed, the initiating process goes well.

* Update network.md to show android non ssl block (facebook#2245)

* Update network.md to show android non ssl block

added note for android's android:usesCleartextTraffic flag in manifest file to allow non ssl encrypted networking - to go alongside the existing note for ios.

* small text tweaks

Co-authored-by: Bartosz Kaszubowski <gosimek@gmail.com>

* remove link in native-modules-ios (facebook#2244)

Co-authored-by: luism3861 <eduardo_media@fragua.com.mx>

* Update textinput.md (facebook#2249)

* Update textinput.md

This will make it more clear for beginners who are trying to use onBlur to do a final action on their textInput's text value.

* formatting, text tweaks

Co-authored-by: Bartosz Kaszubowski <gosimek@gmail.com>

* revert change to Netlify config due to V2 test merge

Co-authored-by: Georgios Kotziabassis <kotziabassis@gmail.com>
Co-authored-by: Muhammad Saeed <37156636+Stringsaeed@users.noreply.github.com>
Co-authored-by: Bartosz Kaszubowski <gosimek@gmail.com>
Co-authored-by: Mojtaba Vandaei <62926492+mojvan@users.noreply.github.com>
Co-authored-by: Steven Luscher <steveluscher@users.noreply.github.com>
Co-authored-by: Pratik Khandelwal <prkhandelwal@hotmail.com>
Co-authored-by: R Nabors <rachelnabors@users.noreply.github.com>
Co-authored-by: Jesse Katsumata <jesse.katsumata@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Joe Bernard <joe@joebernard.com>
Co-authored-by: Thibault Malbranche <thibault.malbranche@epitech.eu>
Co-authored-by: Luis Miguel Alvarado <luismiguel1730@gmail.com>
Co-authored-by: Pramod Kotipalli <p13i@users.noreply.github.com>
Co-authored-by: Madd.is <github@madd.is>
Co-authored-by: Kirill <laikisounds@gmail.com>
Co-authored-by: Ashwin Mothilal <ashwin.mothilal2124@gmail.com>
Co-authored-by: Christoph Nakazawa <cpojer@fb.com>
Co-authored-by: captDaylight <paul.christophe6@gmail.com>
Co-authored-by: ppichier <pierantonio.pichierri@gmail.com>
Co-authored-by: Varunendra Pratap Singh <vpsingh016@gmail.com>
Co-authored-by: Jessie Anh Nguyen <47696418+jessieAnhNguyen@users.noreply.github.com>
Co-authored-by: Saphal Patro <31125345+saphal1998@users.noreply.github.com>
Co-authored-by: Saphal Patro <saphal1998@gmail.com>
Co-authored-by: Agastya Darma <gedeagas22@gmail.com>
Co-authored-by: Steven Martin <stevenisekimartin@gmail.com>
Co-authored-by: Sebastien Bailouni <sbailouni@gmail.com>
Co-authored-by: Luke Walczak <lukasz.walczak.pwr@gmail.com>
Co-authored-by: Jessica Lin <jlin2700@gmail.com>
Co-authored-by: Vishal Vishwakarma <56310842+vishalvishw10@users.noreply.github.com>
Co-authored-by: Adam Hunter <arhunter@gmail.com>
Co-authored-by: Jessica Lin <jplin@fb.com>
Co-authored-by: Ashish Shakya <41261918+Ashish1101@users.noreply.github.com>
Co-authored-by: Sunny Luo <sunnylqm@gmail.com>
Co-authored-by: Alexander Sklar <asklar@microsoft.com>
Co-authored-by: s-maurice <51819025+s-maurice@users.noreply.github.com>
Co-authored-by: luism3861 <36824170+luism3861@users.noreply.github.com>
Co-authored-by: luism3861 <eduardo_media@fragua.com.mx>
Co-authored-by: Ralph Maamari <ralphpal@hotmail.com>
  • Loading branch information
Show file tree
Hide file tree
Showing 84 changed files with 3,260 additions and 1,370 deletions.
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

0 comments on commit f31a50f

Please sign in to comment.