Skip to content

Commit 5b3e823

Browse files
authored
docs: fix TS API deprecated types link (#4883)
1 parent 94ef98a commit 5b3e823

File tree

5 files changed

+27
-4
lines changed

5 files changed

+27
-4
lines changed

docs/strict-typescript-api.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ id: strict-typescript-api
33
title: Strict TypeScript API (opt in)
44
---
55

6+
import RNRepoLink from '@site/core/RNRepoLink';
7+
68
The Strict TypeScript API is a preview of our future, stable JavaScript API for React Native.
79

810
Specifically, this is a new set of TypeScript types for the `react-native` npm package, available from 0.80 onwards. These provide stronger and more futureproof type accuracy, and will allow us to confidently evolve React Native's API into a stable shape. Opting in to the Strict TypeScript API brings some structural type differences, and is therefore a one-time breaking change.
@@ -178,7 +180,7 @@ In the new types, every optional prop will be typed as `type | undefined`.
178180

179181
### Removal of some deprecated types
180182

181-
All types listed in [`DeprecatedPropertiesAlias.d.ts`](https://github.com/facebook/react-native/blob/0.80-stable/packages/react-native/types/public/DeprecatedPropertiesAlias.d.ts) are inaccessible under the Strict API.
183+
All types listed in <RNRepoLink href="/packages/react-native/types/public/DeprecatedPropertiesAlias.d.ts">`DeprecatedPropertiesAlias.d.ts`</RNRepoLink> are inaccessible under the Strict API.
182184

183185
### Removal of leftover component props
184186

website/core/RNRepoLink.tsx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import A from '@theme/MDXComponents/A';
2+
import type {ComponentProps} from 'react';
3+
import {getTemplateBranchNameForCurrentVersion} from '../src/getTemplateBranchNameForCurrentVersion';
4+
5+
type Props = ComponentProps<'a'>;
6+
7+
export default function RNRepoLink({href, children, ...rest}: Props) {
8+
return (
9+
<A
10+
href={`https://github.com/facebook/react-native/blob/${getTemplateBranchNameForCurrentVersion()}/${href.startsWith('/') ? href.slice(1) : href}`}
11+
{...rest}>
12+
{children}
13+
</A>
14+
);
15+
}

website/versioned_docs/version-0.80/strict-typescript-api.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ id: strict-typescript-api
33
title: Strict TypeScript API (opt in)
44
---
55

6+
import RNRepoLink from '@site/core/RNRepoLink';
7+
68
The Strict TypeScript API is a preview of our future, stable JavaScript API for React Native.
79

810
Specifically, this is a new set of TypeScript types for the `react-native` npm package, available from 0.80 onwards. These provide stronger and more futureproof type accuracy, and will allow us to confidently evolve React Native's API into a stable shape. Opting in to the Strict TypeScript API brings some structural type differences, and is therefore a one-time breaking change.
@@ -178,7 +180,7 @@ In the new types, every optional prop will be typed as `type | undefined`.
178180

179181
### Removal of some deprecated types
180182

181-
All types listed in [`DeprecatedPropertiesAlias.d.ts`](https://github.com/facebook/react-native/blob/0.80-stable/packages/react-native/types/public/DeprecatedPropertiesAlias.d.ts) are inaccessible under the Strict API.
183+
All types listed in <RNRepoLink href="/packages/react-native/types/public/DeprecatedPropertiesAlias.d.ts">`DeprecatedPropertiesAlias.d.ts`</RNRepoLink> are inaccessible under the Strict API.
182184

183185
### Removal of leftover component props
184186

website/versioned_docs/version-0.81/strict-typescript-api.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ id: strict-typescript-api
33
title: Strict TypeScript API (opt in)
44
---
55

6+
import RNRepoLink from '@site/core/RNRepoLink';
7+
68
The Strict TypeScript API is a preview of our future, stable JavaScript API for React Native.
79

810
Specifically, this is a new set of TypeScript types for the `react-native` npm package, available from 0.80 onwards. These provide stronger and more futureproof type accuracy, and will allow us to confidently evolve React Native's API into a stable shape. Opting in to the Strict TypeScript API brings some structural type differences, and is therefore a one-time breaking change.
@@ -178,7 +180,7 @@ In the new types, every optional prop will be typed as `type | undefined`.
178180

179181
### Removal of some deprecated types
180182

181-
All types listed in [`DeprecatedPropertiesAlias.d.ts`](https://github.com/facebook/react-native/blob/0.80-stable/packages/react-native/types/public/DeprecatedPropertiesAlias.d.ts) are inaccessible under the Strict API.
183+
All types listed in <RNRepoLink href="/packages/react-native/types/public/DeprecatedPropertiesAlias.d.ts">`DeprecatedPropertiesAlias.d.ts`</RNRepoLink> are inaccessible under the Strict API.
182184

183185
### Removal of leftover component props
184186

website/versioned_docs/version-0.82/strict-typescript-api.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ id: strict-typescript-api
33
title: Strict TypeScript API (opt in)
44
---
55

6+
import RNRepoLink from '@site/core/RNRepoLink';
7+
68
The Strict TypeScript API is a preview of our future, stable JavaScript API for React Native.
79

810
Specifically, this is a new set of TypeScript types for the `react-native` npm package, available from 0.80 onwards. These provide stronger and more futureproof type accuracy, and will allow us to confidently evolve React Native's API into a stable shape. Opting in to the Strict TypeScript API brings some structural type differences, and is therefore a one-time breaking change.
@@ -178,7 +180,7 @@ In the new types, every optional prop will be typed as `type | undefined`.
178180

179181
### Removal of some deprecated types
180182

181-
All types listed in [`DeprecatedPropertiesAlias.d.ts`](https://github.com/facebook/react-native/blob/0.80-stable/packages/react-native/types/public/DeprecatedPropertiesAlias.d.ts) are inaccessible under the Strict API.
183+
All types listed in <RNRepoLink href="/packages/react-native/types/public/DeprecatedPropertiesAlias.d.ts">`DeprecatedPropertiesAlias.d.ts`</RNRepoLink> are inaccessible under the Strict API.
182184

183185
### Removal of leftover component props
184186

0 commit comments

Comments
 (0)