Skip to content

Commit

Permalink
changes from the Prettier run
Browse files Browse the repository at this point in the history
  • Loading branch information
Simek committed Jun 18, 2020
1 parent 3b402c2 commit 5145ab3
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 16 deletions.
2 changes: 1 addition & 1 deletion docs/native-modules-android.md
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ const measureLayout = async () => {
} catch (e) {
console.error(e);
}
}
};
measureLayout();
```
Expand Down
2 changes: 1 addition & 1 deletion docs/native-modules-ios.md
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ const updateEvents = async () => {
} catch (e) {
console.error(e);
}
}
};
updateEvents();
```
Expand Down
8 changes: 4 additions & 4 deletions docs/navigation.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ const App = () => {
{/* Rest of your app code */}
</NavigationContainer>
);
}
};
export default App;
```
Expand Down Expand Up @@ -95,7 +95,7 @@ const MyStack = () => {
</Stack.Navigator>
</NavigationContainer>
);
}
};
```
In this example, there are 2 screens (`Home` and `Profile`) defined using the `Stack.Screen` component. Similarly, you can define as many screens as you like.
Expand All @@ -114,10 +114,10 @@ const HomeScreen = ({ navigation }) => {
}
/>
);
}
};
const ProfileScreen = () => {
return <Text>This is Jane's profile</Text>;
}
};
```
The views in the stack navigator use native components and the [`Animated`](animated.md) library to deliver 60fps animations that are run on the native thread. Plus, the animations and gestures can be customized.
Expand Down
4 changes: 2 additions & 2 deletions docs/network.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const getMoviesFromApi = () => {
.catch((error) => {
console.error(error);
});
}
};
```

You can also use the `async` / `await` syntax in a React Native app:
Expand All @@ -67,7 +67,7 @@ const getMoviesFromApiAsync = async () => {
} catch (error) {
console.error(error);
}
}
};
```

Don't forget to catch any errors that may be thrown by `fetch`, otherwise they will be dropped silently.
Expand Down
12 changes: 8 additions & 4 deletions website/versioned_docs/version-0.5/accessibility.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,12 +172,12 @@ In the case of two overlapping UI components with the same parent, default acces
```jsx
<View style={styles.container}>
<View
style={[styles.layout, {backgroundColor: 'green'}]}
style={[styles.layout, { backgroundColor: 'green' }]}
importantForAccessibility="yes">
<Text>First layout</Text>
</View>
<View
style={[styles.layout, {backgroundColor: 'yellow'}]}
style={[styles.layout, { backgroundColor: 'yellow' }]}
importantForAccessibility="no-hide-descendants">
<Text>Second layout</Text>
</View>
Expand Down Expand Up @@ -248,12 +248,16 @@ The `AccessibilityInfo` API allows you to determine whether or not a screen read
Sometimes it is useful to trigger an accessibility event on a UI component (i.e. when a custom view appears on a screen or set accessibility focus to a view). Native UIManager module exposes a method ‘sendAccessibilityEvent’ for this purpose. It takes two arguments: view tag and a type of an event. The supported event types are `typeWindowStateChanged`, `typeViewFocused` and `typeViewClicked`.

```jsx
import {Platform, UIManager, findNodeHandle} from 'react-native';
import {
Platform,
UIManager,
findNodeHandle
} from 'react-native';

if (Platform.OS === 'android') {
UIManager.sendAccessibilityEvent(
findNodeHandle(this),
UIManager.AccessibilityEventTypes.typeViewFocused,
UIManager.AccessibilityEventTypes.typeViewFocused
);
}
```
Expand Down
12 changes: 8 additions & 4 deletions website/versioned_docs/version-0.62/accessibility.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,12 +185,12 @@ In the case of two overlapping UI components with the same parent, default acces
```jsx
<View style={styles.container}>
<View
style={[styles.layout, {backgroundColor: 'green'}]}
style={[styles.layout, { backgroundColor: 'green' }]}
importantForAccessibility="yes">
<Text>First layout</Text>
</View>
<View
style={[styles.layout, {backgroundColor: 'yellow'}]}
style={[styles.layout, { backgroundColor: 'yellow' }]}
importantForAccessibility="no-hide-descendants">
<Text>Second layout</Text>
</View>
Expand Down Expand Up @@ -261,12 +261,16 @@ The `AccessibilityInfo` API allows you to determine whether or not a screen read
Sometimes it is useful to trigger an accessibility event on a UI component (i.e. when a custom view appears on a screen or set accessibility focus to a view). Native UIManager module exposes a method ‘sendAccessibilityEvent’ for this purpose. It takes two arguments: view tag and a type of an event. The supported event types are `typeWindowStateChanged`, `typeViewFocused` and `typeViewClicked`.

```jsx
import {Platform, UIManager, findNodeHandle} from 'react-native';
import {
Platform,
UIManager,
findNodeHandle
} from 'react-native';

if (Platform.OS === 'android') {
UIManager.sendAccessibilityEvent(
findNodeHandle(this),
UIManager.AccessibilityEventTypes.typeViewFocused,
UIManager.AccessibilityEventTypes.typeViewFocused
);
}
```
Expand Down

0 comments on commit 5145ab3

Please sign in to comment.