Skip to content

Commit 0a4f26f

Browse files
sunnylqmdeveloper239rogisolorzanoblackprShindeNayan17
authored
0711 sync 0.63 (#204)
* Fix wrong endBlock in text.md (facebook#1991) * fix: update installation instructions (facebook#1989) * Fixed DrawerLayoutAndroid padding syntax which was causing the Expo Snack to crash (facebook#1995) * Docs: Update react-native-unimodules link (facebook#1994) The react-native-unimodules link is updated. The current repo has been deprecated in favor of expo/expo monorepo * Bug Fix facebook#1993 (facebook#1996) * remove letter "s" inputaccesoryview.md (facebook#1997) * use platform labels on the Accessibility page (facebook#1948) * order accessibilityRoles alphabetically * Getting Rid of In-Content Links (facebook#1970) * Got rid of intext links and updated referenes to navigator * Removed package lock * add NavigationIOS removal notice, update links Co-authored-by: Bartosz Kaszubowski <gosimek@gmail.com> * Add two words to platform-specific-code.md (facebook#1999) * update second example in Flatlist docs (facebook#1998) * update flatlist example, select one button and change color * complete changes in examples * retain Item as separate component, use native StatusBar height, prettier run Co-authored-by: Bartosz Kaszubowski <gosimek@gmail.com> * Update accessibilityinfo.md (facebook#1977) * Update accessibilityinfo.md Since AccessibilityInfo.fetch is deprecated, I changed it with AccessibilityInfo.isReduceMotionEnabled and AccessibilityInfo.isScreenReaderEnabled * fix syntax error, remove web platform, tweak readability Co-authored-by: Bartosz Kaszubowski <gosimek@gmail.com> * fix reported invalid links (facebook#1981) * changes from the Prettier run (facebook#2000) * fix links in images.md (facebook#2002) * fix onPageNav height with announcement (facebook#2006) * Fix bug in example of functional component (facebook#2004) * Remove legacyImplementation (facebook#2012) facebook/react-native@636d01b * Replace YellowBox docs with LogBox docs. (facebook#2020) * Replace YellowBox docs with LogBox docs. * Fix language lint errors * Update debugging.md Some typos and rewordings * Update debugging.md Co-authored-by: Eli White <github@eli-white.com> * Update flatlist.md (facebook#2022) Example in renderItem Have a syntax error in ItemSeparatorComponent * Fixed code snippet. (facebook#2015) new ReactImageManager(..here..), ReactImageManager 's constructer needs reactContext, we passed it. * Remove duplicate documentation property for statusBarTranslucent on Modal (facebook#2023) * Remove duplicate documentation property for statusBarTranslucent on Modal * Sort properties alphabetically * Add an ability to slide up announcement bar on scroll (facebook#2018) * slide up announcement banner on scroll * fix for desktop resizing on macOS * apply fix only on mobile * remove unused variables declarations and parameters in different files. (facebook#2010) * delete unused variables declarations and parameters * remove accent in parameters * add variable params * Fixed the Function Component Example (facebook#2019) * Fixed the Function Component Example We experienced that the documentation was faulty so after we at @enpit found a fix, we wanted to share it with you. The old trigger `appState.current.match(/inactive|background/) && nextAppState === "active"` would never work because the useState hook doesn't update the state fast enough for the function to work. The solution is to use useRef instead and optional (to display the inactive status under iOS) also use a `useState` for cosmetics. * removed block comment, removed spaces * rephrase and move new comment, add one more sentence, prettier run * language lint fix Co-authored-by: Bartosz Kaszubowski <gosimek@gmail.com> * Blog post for the 0.63 release (facebook#2024) * commit the article * Update 2020-07-06-version-0.63.md * Update 2020-07-06-version-0.63.md * Update website/blog/2020-07-06-version-0.63.md Co-authored-by: Ricky <rickhanlonii@gmail.com> * Update website/blog/2020-07-06-version-0.63.md Co-authored-by: Ricky <rickhanlonii@gmail.com> * Update website/blog/2020-07-06-version-0.63.md Co-authored-by: Ricky <rickhanlonii@gmail.com> * Update 2020-07-06-version-0.63.md * chore: refactor to a css * Updating the Pressable introduction Co-authored-by: Ricky <rickhanlonii@gmail.com> Co-authored-by: Eli White <github@eli-white.com> * feat: ship 0.63 docs (facebook#2030) * Fix Alert API docs (facebook#2027) * Fix Alert API docs * Update docs/alert.md Co-authored-by: Ricky <rickhanlonii@gmail.com> * Update docs/alert.md Co-authored-by: Ricky <rickhanlonii@gmail.com> * Update docs/alert.md Co-authored-by: Ricky <rickhanlonii@gmail.com> Co-authored-by: Ricky <rickhanlonii@gmail.com> * adding docs for android_hyphenationStrategy (facebook#2007) * updated default folder location for Android Sdk in Windows (facebook#2008) * updated default folder location for Android Sdk in Windows Matching the configuration screenshot of the default folder location. I had some trouble during environment configuration when I figured out that the location from the screenshot provided was the correct one (for the Sdk location). * Update docs/getting-started.md Co-authored-by: Kid <44045911+kidonng@users.noreply.github.com> * Link to the actual Upgrade Helper, not the GitHub repo for it (facebook#2034) Co-authored-by: Michal <developer239@users.noreply.github.com> Co-authored-by: Rogi Solorzano <36051536+rogisolorzano@users.noreply.github.com> Co-authored-by: Tim Pap <blackpr.tim@gmail.com> Co-authored-by: Nayan Shinde <shinde.nayan16@gmail.com> Co-authored-by: luism3861 <36824170+luism3861@users.noreply.github.com> Co-authored-by: Bartosz Kaszubowski <gosimek@gmail.com> Co-authored-by: JP Bulman <jpbulman@wpi.edu> Co-authored-by: Doga Fincan <doga@icloud.com> Co-authored-by: truecuozzo98 <52197438+truecuozzo98@users.noreply.github.com> Co-authored-by: ttlong3103 <tranthanhlong3103@gmail.com> Co-authored-by: Ricky <rickhanlonii@gmail.com> Co-authored-by: Eli White <github@eli-white.com> Co-authored-by: SABRYX <32037441+SABRYX@users.noreply.github.com> Co-authored-by: Surya Chandra Pavan Adurthi <p2pdops@gmail.com> Co-authored-by: Levi Buzolic <levibuzolic@gmail.com> Co-authored-by: Chris Winter <chris-winter@live.de> Co-authored-by: Mike Grabowski <grabbou@gmail.com> Co-authored-by: Ankit Tiwari <ankitt255@gmail.com> Co-authored-by: fabriziobertoglio1987 <fabrizio.bertoglio@gmail.com> Co-authored-by: Celso Wellington <celso.w.dias.a@gmail.com> Co-authored-by: Kid <44045911+kidonng@users.noreply.github.com> Co-authored-by: Steven Conaway <steven.conaway@icloud.com>
1 parent f6eb4fb commit 0a4f26f

File tree

150 files changed

+26473
-810
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

150 files changed

+26473
-810
lines changed

docs/accessibility.md

Lines changed: 69 additions & 65 deletions
Large diffs are not rendered by default.

docs/accessibilityinfo.md

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ Sometimes it's useful to know whether or not the device has a screen reader that
2020

2121
<block class="functional syntax" />
2222

23-
```SnackPlayer name=AccessibilityInfo%20Function%20Component%20Example
24-
23+
```SnackPlayer name=AccessibilityInfo%20Function%20Component%20Example&supportedPlatforms=android,ios
2524
import React, { useState, useEffect } from "react";
2625
import { AccessibilityInfo, View, Text, StyleSheet } from "react-native";
2726
@@ -39,18 +38,22 @@ const App = () => {
3938
handleScreenReaderToggled
4039
);
4140
42-
AccessibilityInfo.fetch().then(reduceMotionEnabled => {
43-
setReduceMotionEnabled(reduceMotionEnabled);
44-
});
45-
AccessibilityInfo.fetch().then(screenReaderEnabled => {
46-
setScreenReaderEnabled(screenReaderEnabled);
47-
});
41+
AccessibilityInfo.isReduceMotionEnabled().then(
42+
reduceMotionEnabled => {
43+
setReduceMotionEnabled(reduceMotionEnabled);
44+
}
45+
);
46+
AccessibilityInfo.isScreenReaderEnabled().then(
47+
screenReaderEnabled => {
48+
setScreenReaderEnabled(screenReaderEnabled);
49+
}
50+
);
51+
4852
return () => {
4953
AccessibilityInfo.removeEventListener(
5054
"reduceMotionChanged",
5155
handleReduceMotionToggled
5256
);
53-
5457
AccessibilityInfo.removeEventListener(
5558
"screenReaderChanged",
5659
handleScreenReaderToggled
@@ -94,8 +97,7 @@ export default App;
9497

9598
<block class="classical syntax" />
9699

97-
```SnackPlayer name=AccessibilityInfo%20Class%20Component%20Example
98-
100+
```SnackPlayer name=AccessibilityInfo%20Class%20Component%20Example&supportedPlatforms=android,ios
99101
import React, { Component } from 'react';
100102
import { AccessibilityInfo, View, Text, StyleSheet } from 'react-native';
101103
@@ -115,10 +117,10 @@ class AccessibilityStatusExample extends Component {
115117
this._handleScreenReaderToggled
116118
);
117119
118-
AccessibilityInfo.fetch().then(reduceMotionEnabled => {
120+
AccessibilityInfo.isReduceMotionEnabled().then(reduceMotionEnabled => {
119121
this.setState({ reduceMotionEnabled });
120122
});
121-
AccessibilityInfo.fetch().then(screenReaderEnabled => {
123+
AccessibilityInfo.isScreenReaderEnabled().then(screenReaderEnabled => {
122124
this.setState({ screenReaderEnabled });
123125
});
124126
}

docs/alert.md

Lines changed: 26 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,7 @@ const App = () => {
4040
style: "cancel"
4141
},
4242
{ text: "OK", onPress: () => console.log("OK Pressed") }
43-
],
44-
{ cancelable: false }
43+
]
4544
);
4645
4746
const createThreeButtonAlert = () =>
@@ -59,8 +58,7 @@ const App = () => {
5958
style: "cancel"
6059
},
6160
{ text: "OK", onPress: () => console.log("OK Pressed") }
62-
],
63-
{ cancelable: false }
61+
]
6462
);
6563
6664
return (
@@ -101,8 +99,7 @@ class App extends Component {
10199
style: "cancel"
102100
},
103101
{ text: "OK", onPress: () => console.log("OK Pressed") }
104-
],
105-
{ cancelable: false }
102+
]
106103
);
107104
108105
createThreeButtonAlert = () =>
@@ -120,8 +117,7 @@ class App extends Component {
120117
style: "cancel"
121118
},
122119
{ text: "OK", onPress: () => console.log("OK Pressed") }
123-
],
124-
{ cancelable: false }
120+
]
125121
);
126122
127123
render() {
@@ -163,31 +159,33 @@ On Android at most three buttons can be specified. Android has a concept of a ne
163159
- Two buttons mean 'negative', 'positive' (such as 'Cancel', 'OK')
164160
- Three buttons mean 'neutral', 'negative', 'positive' (such as 'Later', 'Cancel', 'OK')
165161

166-
By default alerts on Android can be dismissed by tapping outside of the alert box. This event can be handled by providing an optional `options` parameter, with an `onDismiss` callback property `{ onDismiss: () => {} }`.
162+
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 }`.
167163

168-
Alternatively, the dismissing behavior can be disabled altogether by providing an optional options parameter with the cancelable property set to false i.e. `{ cancelable: false }`.
164+
The cancel event can be handled by providing an `onDismiss` callback property `{ onDismiss: () => {} }` inside the `options` parameter.
169165

170166
Example usage:
171167

172168
```jsx
173-
// Works on both Android and iOS
174-
Alert.alert(
175-
'Alert Title',
176-
'My Alert Msg',
177-
[
178-
{
179-
text: 'Ask me later',
180-
onPress: () => console.log('Ask me later pressed')
181-
},
182-
{
183-
text: 'Cancel',
184-
onPress: () => console.log('Cancel Pressed'),
185-
style: 'cancel'
186-
},
187-
{ text: 'OK', onPress: () => console.log('OK Pressed') }
188-
],
189-
{ cancelable: false }
190-
);
169+
Alert.alert('Alert Title', 'My Alert Msg', [
170+
{
171+
text: 'Ask me later',
172+
onPress: () => console.log('Ask me later pressed')
173+
},
174+
{
175+
text: 'Cancel',
176+
onPress: () => console.log('Cancel Pressed'),
177+
style: 'cancel'
178+
},
179+
{ text: 'OK', onPress: () => console.log('OK Pressed') },
180+
{
181+
// cancelable and onDismiss only work on Android.
182+
cancelable: true,
183+
onDismiss: () =>
184+
console.log(
185+
'This alert was dismissed by tapping outside of the alert dialog.'
186+
)
187+
}
188+
]);
191189
```
192190

193191
---

docs/appstate.md

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,12 @@ To see the current state, you can check `AppState.currentState`, which will be k
3636
<block class="functional syntax" />
3737

3838
```SnackPlayer name=AppState%20Function%20Component%20Example
39-
import React, { useEffect, useRef } from "react";
39+
import React, { useRef, useState, useEffect } from "react";
4040
import { AppState, StyleSheet, Text, View } from "react-native";
4141
4242
const AppStateExample = () => {
4343
const appState = useRef(AppState.currentState);
44+
const [appStateVisible, setAppStateVisible] = useState(appState.current);
4445
4546
useEffect(() => {
4647
AppState.addEventListener("change", _handleAppStateChange);
@@ -51,15 +52,21 @@ const AppStateExample = () => {
5152
}, []);
5253
5354
const _handleAppStateChange = (nextAppState) => {
54-
if (appState.current.match(/inactive|background/) && nextAppState === "active") {
55+
if (
56+
appState.current.match(/inactive|background/) &&
57+
nextAppState === "active"
58+
) {
5559
console.log("App has come to the foreground!");
5660
}
61+
5762
appState.current = nextAppState;
63+
setAppStateVisible(appState.current);
64+
console.log("AppState", appState.current);
5865
};
5966
6067
return (
6168
<View style={styles.container}>
62-
<Text>Current state is: {appState.current}</Text>
69+
<Text>Current state is: {appStateVisible}</Text>
6370
</View>
6471
);
6572
};
@@ -68,13 +75,15 @@ const styles = StyleSheet.create({
6875
container: {
6976
flex: 1,
7077
justifyContent: "center",
71-
alignItems: "center"
72-
}
78+
alignItems: "center",
79+
},
7380
});
7481
7582
export default AppStateExample;
7683
```
7784

85+
If you don't want to see the AppState update from `active` to `inactive` on iOS you can remove the state variable and use the `appState.current` value.
86+
7887
<block class="classical syntax" />
7988

8089
```SnackPlayer name=AppState%20Class%20Component%20Example
@@ -126,7 +135,7 @@ export default AppStateExample;
126135

127136
<block class="endBlock syntax" />
128137

129-
This example will only ever appear to say "Current state is: active" because the app is only visible to the user when in the `active` state, and the null state will happen only momentarily.
138+
This example will only ever appear to say "Current state is: active" because the app is only visible to the user when in the `active` state, and the null state will happen only momentarily. If you want to experiment with the code we recommend to use your own device instead of embedded preview.
130139

131140
---
132141

docs/debugging.md

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,30 +19,37 @@ Fast Refresh is a React Native feature that allows you to get near-instant feedb
1919

2020
React Native supports a few keyboard shortcuts in the iOS Simulator. They are described below. To enable them, open the Hardware menu, select Keyboard, and make sure that "Connect Hardware Keyboard" is checked.
2121

22-
## In-app Errors and Warnings
22+
## LogBox
2323

24-
Errors and warnings are displayed inside your app in development builds.
24+
Errors and warnings in development builds are displayed in LogBox inside your app.
2525

26-
### Errors
26+
> LogBox is automatically disabled in release (production) builds.
2727
28-
In-app errors are displayed in a full screen alert with a red background inside your app. This screen is known as a RedBox. You can use `console.error()` to manually trigger one.
28+
### Console Errors and Warnings
2929

30-
### Warnings
30+
Console errors and warnings are displayed as on-screen notifications with a red or yellow badge, and the number of errors or warning in the console respectively. To view a console error or warnings, tap the notification to view the full screen information about the log and to paginiate through all of the logs in the console.
3131

32-
Warnings will be displayed on screen with a yellow background. These alerts are known as YellowBoxes. Click on the alerts to show more information or to dismiss them.
32+
These notifications can be hidden using `LogBox.ignoreAllLogs()`. This is useful when giving product demos, for example. Additionally, notifications can be hidden on a per-log basis via `LogBox.ignoreLogs()`. This is useful when there's a noisy warning that cannot be fixed, like those in a third-party dependency.
3333

34-
As with a RedBox, you can use `console.warn()` to trigger a YellowBox.
35-
36-
YellowBoxes can be disabled during development by using `console.disableYellowBox = true;`. Specific warnings can be ignored programmatically by setting an array of prefixes that should be ignored:
34+
> Ignore logs as a last resort and create a task to fix any logs that are ignored.
3735
3836
```jsx
39-
import { YellowBox } from 'react-native';
40-
YellowBox.ignoreWarnings(['Warning: ...']);
37+
import { LogBox } from 'react-native';
38+
39+
// Ignore log notification by message:
40+
LogBox.ignoreLogs(['Warning: ...']);
41+
42+
// Ignore all log notifications:
43+
LogBox.ignoreAllLogs();
4144
```
4245

43-
In CI/Xcode, YellowBoxes can also be disabled by setting the `IS_TESTING` environment variable.
46+
### Unhandled Errors
47+
48+
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.
49+
50+
### Syntax Erorrs
4451

45-
> RedBoxes and YellowBoxes are automatically disabled in release (production) builds.
52+
Syntax errors will automatically open a full screen LogBox error with the source of the syntax error. This error is not dismissable because it represents invalid JavaScript execution that must be fixed before continuing with your app. To dismiss these errors, fix the syntax error and either save to automatically dismiss (with Fast Refresh enabled) or cmd+r to reload (with Fast Refresh disabled).
4653

4754
## Chrome Developer Tools
4855

docs/drawerlayoutandroid.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,13 @@ const styles = StyleSheet.create({
5454
flex: 1,
5555
alignItems: "center",
5656
justifyContent: "center",
57-
paddingTop: "50px",
57+
paddingTop: 50,
5858
backgroundColor: "#ecf0f1",
5959
padding: 8
6060
},
6161
navigationContainer: {
6262
flex: 1,
63-
paddingTop: "50px",
63+
paddingTop: 50,
6464
backgroundColor: "#fff",
6565
padding: 8
6666
}

0 commit comments

Comments
 (0)