Skip to content

Commit 5045ce8

Browse files
committed
Fix broken anchor links
1 parent c5d548d commit 5045ce8

Some content is hidden

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

52 files changed

+91
-111
lines changed

blog/2020-02-06-react-navigation-5.0.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ Hooks are great for stateful logic and code organization. Now we have several ho
5353

5454
### Update options from component
5555

56-
We’ve added a new [`setOptions`](/docs/5.x/navigation-prop#setoptions---update-screen-options-from-the-component) method on the `navigation` prop to make configuring screen navigation options more intuitive than its `static navigationOptions` predecessor. It lets us **easily set screen options based on props, state or context without messing with params**. Instead of using static options, we can call it anytime to configure the screen.
56+
We’ve added a new [`setOptions`](/docs/5.x/navigation-prop#setoptions) method on the `navigation` prop to make configuring screen navigation options more intuitive than its `static navigationOptions` predecessor. It lets us **easily set screen options based on props, state or context without messing with params**. Instead of using static options, we can call it anytime to configure the screen.
5757

5858
```js
5959
navigation.setOptions({

docusaurus.config.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ export default {
1212
favicon: 'img/favicon.ico',
1313
organizationName: 'react-navigation',
1414
projectName: 'react-navigation.github.io',
15+
onBrokenAnchors: 'throw',
16+
onBrokenMarkdownLinks: 'throw',
1517
scripts: ['/js/snack-helpers.js', '/js/toc-fixes.js'],
1618
themeConfig: {
1719
colorMode: {

static/js/snack-helpers.js

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -184,24 +184,11 @@ function appendSnackLink() {
184184
});
185185
}
186186

187-
// This is used to update links like the following:
188-
// [Full source of what we have built so far](#example/full-screen-modal)
189-
function transformExistingSnackLinks() {
190-
document.querySelectorAll('a[href*="#example/"]').forEach((a) => {
191-
let urlParts = a.href.split('#example/');
192-
let templateId = urlParts[urlParts.length - 1];
193-
a.href = getSnackUrl({ templateId });
194-
a.target = '_blank';
195-
});
196-
}
197-
198187
function initializeSnackObservers() {
199188
appendSnackLink();
200-
transformExistingSnackLinks();
201189

202190
const mutationObserver = new MutationObserver((mutations) => {
203191
mutations.forEach(appendSnackLink);
204-
mutations.forEach(transformExistingSnackLinks);
205192
});
206193

207194
mutationObserver.observe(document.documentElement, {

versioned_docs/version-1.x/navigation-actions.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ The following actions are supported:
1313
- [Navigate](#navigate) - Navigate to another route
1414
- [Back](#back) - Go back to previous state
1515
- [Set Params](#setparams) - Set Params for given route
16-
- [Init](#init) - Used to initialize first state if state is undefined
16+
- Init - Used to initialize first state if state is undefined
1717

1818
Within a stack, you can also use:
1919

2020
- [Reset](#reset) - Replace current state with a new state
2121
- [Replace](#replace) - Replace a route at a given key with another route
22-
- [Push](#push) - Add a route on the top of the stack, and navigate forward to it
23-
- [Pop](#pop) - Navigate back to previous routes
24-
- [PopToTop](#poptotop) - Navigate to the top route of the stack, dismissing all other routes
22+
- Push - Add a route on the top of the stack, and navigate forward to it
23+
- Pop - Navigate back to previous routes
24+
- PopToTop - Navigate to the top route of the stack, dismissing all other routes
2525

2626
The action creator functions define `toString()` to return the action type, which enables easy usage with third-party Redux libraries, including redux-actions and redux-saga.
2727

versioned_docs/version-1.x/navigation-options.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,5 +102,5 @@ List of available navigation options depends on the `navigator` the screen is ad
102102
Check available options for:
103103
104104
- [`drawer navigator`](drawer-navigator.md#screen-navigation-options)
105-
- [`stack navigator`](stack-navigator.md#screen-navigation-options)
106-
- [`tab navigator`](tab-navigator.md#screen-navigation-options)
105+
- [`stack navigator`](stack-navigator.md#navigationoptions-used-by-stacknavigator)
106+
- [`tab navigator`](tab-navigator.md#navigationoptions-used-by-tabnavigator)

versioned_docs/version-1.x/redux-integration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ _You probably do not need to do this!_ Storing your React Navigation state in yo
1414

1515
1. To handle your app's navigation state in Redux, you can pass your own `navigation` prop to a navigator.
1616

17-
2. Once you pass your own navigation prop to the navigator, the default [`navigation`](navigation-prop.md) prop gets destroyed. You must construct your own `navigation` prop with [`state`](navigation-prop.md#state-the-screen-s-current-state-route), [`dispatch`](navigation-prop.md#dispatch-send-an-action-to-the-router), and `addListener` properties.
17+
2. Once you pass your own navigation prop to the navigator, the default [`navigation`](navigation-prop.md) prop gets destroyed. You must construct your own `navigation` prop with [`state`](navigation-prop.md#state---the-screens-current-stateroute), [`dispatch`](navigation-prop.md#dispatch---send-an-action-to-the-router), and `addListener` properties.
1818

1919
3. The `state` will be fed from the reducer assigned to handle navigation state and the `dispatch` will be Redux's default `dispatch`. Thus you will be able to dispatch normal redux actions using `this.props.navigation.dispatch(ACTION)`, reducer will update the navigation state on the basis of dispatched action, the new navigation state will then be passed to the navigator.
2020

versioned_docs/version-2.x/custom-android-back-button-handling.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ By default, when user presses the Android hardware back button, react-navigation
88

99
> If you're looking for an easy-to-use solution, you can check out a community-developed package [react-navigation-backhandler](https://github.com/vonovak/react-navigation-backhandler). The following text shows what the package does under the cover.
1010
11-
As an example, consider a screen where user is selecting items in a list, and a "selection mode" is active. On a back button press, you would first want the "selection mode" to be deactivated, and the screen should be popped only on the second back button press. The following code snippet demonstrates the situation. We make use of [`BackHandler`](https://reactnative.dev/docs/backhandler.html) which comes with react-native and we [subscribe to navigation lifecycle updates](navigation-prop.md#addlistener-subscribe-to-updates-to-navigation-lifecycle) to add our custom `hardwareBackPress` listener.
11+
As an example, consider a screen where user is selecting items in a list, and a "selection mode" is active. On a back button press, you would first want the "selection mode" to be deactivated, and the screen should be popped only on the second back button press. The following code snippet demonstrates the situation. We make use of [`BackHandler`](https://reactnative.dev/docs/backhandler.html) which comes with react-native and we [subscribe to navigation lifecycle updates](navigation-prop.md#addlistener---subscribe-to-updates-to-navigation-lifecycle) to add our custom `hardwareBackPress` listener.
1212

1313
Returning `true` from `onBackButtonPressAndroid` denotes that we have handled the event, and react-navigation's listener will not get called, thus not popping the screen. Returning `false` will cause the event to bubble up and react-navigation's listener will pop the screen.
1414

versioned_docs/version-2.x/custom-navigator-overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ The navigators render application screens which are just React components.
2424
To learn how to create screens, read about:
2525

2626
- [Screen `navigation` prop](navigation-prop.md) to allow the screen to dispatch navigation actions, such as opening another screen
27-
- Screen `navigationOptions` to customize how the screen gets presented by the navigator (e.g. [header title](stack-navigator.md#navigationoptions-used-by-stacknavigator), tab label)
27+
- Screen `navigationOptions` to customize how the screen gets presented by the navigator (e.g. [header title](stack-navigator.md#navigationoptions-for-screens-inside-of-the-navigator), tab label)
2828

2929
### Calling Navigate on Top Level Component
3030

versioned_docs/version-2.x/drawer-actions.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ sidebar_label: DrawerActions
88

99
The following actions are supported:
1010

11-
- [openDrawer](#openDrawer) - open the drawer
12-
- [closeDrawer](#closeDrawer) - close the drawer
13-
- [toggleDrawer](#toggleDrawer) - toggle the state, ie. switch from closed to open and vice versa
11+
- openDrawer - open the drawer
12+
- closeDrawer - close the drawer
13+
- toggleDrawer - toggle the state, ie. switch from closed to open and vice versa
1414

1515
### Usage
1616

versioned_docs/version-2.x/headers.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,11 +202,11 @@ class HomeScreen extends React.Component {
202202
203203
## Additional configuration
204204

205-
You can read the full list of available `navigationOptions` for screens inside of a stack navigator in the [`createStackNavigator` reference](stack-navigator.md#navigationoptions-used-by-stacknavigator).
205+
You can read the full list of available `navigationOptions` for screens inside of a stack navigator in the [`createStackNavigator` reference](stack-navigator.md#navigationoptions-for-screens-inside-of-the-navigator).
206206

207207
## Summary
208208

209-
- You can customize the header inside of the `navigationOptions` static property on your screen components. Read the full list of options [in the API reference](stack-navigator.md#navigationoptions-used-by-stacknavigator).
209+
- You can customize the header inside of the `navigationOptions` static property on your screen components. Read the full list of options [in the API reference](stack-navigator.md#navigationoptions-for-screens-inside-of-the-navigator).
210210
- The `navigationOptions` static property can be an object or a function. When it is a function, it is provided with an object with the `navigation` prop, `screenProps`, and `navigationOptions` on it.
211211
- You can also specify shared `navigationOptions` in the stack navigator configuration when you initialize it. The static property takes precedence over that configuration.
212212
- [Full source of what we have built so far](https://snack.expo.io/@react-navigation/custom-header-title-component-v2).

0 commit comments

Comments
 (0)