Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion docs/strict-typescript-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ id: strict-typescript-api
title: Strict TypeScript API (opt in)
---

import RNRepoLink from '@site/core/RNRepoLink';

The Strict TypeScript API is a preview of our future, stable JavaScript API for React Native.

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.
Expand Down Expand Up @@ -178,7 +180,7 @@ In the new types, every optional prop will be typed as `type | undefined`.

### Removal of some deprecated types

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.
All types listed in <RNRepoLink href="/packages/react-native/types/public/DeprecatedPropertiesAlias.d.ts">`DeprecatedPropertiesAlias.d.ts`</RNRepoLink> are inaccessible under the Strict API.

### Removal of leftover component props

Expand Down
15 changes: 15 additions & 0 deletions website/core/RNRepoLink.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import A from '@theme/MDXComponents/A';
import type {ComponentProps} from 'react';
import {getTemplateBranchNameForCurrentVersion} from '../src/getTemplateBranchNameForCurrentVersion';

type Props = ComponentProps<'a'>;

export default function RNRepoLink({href, children, ...rest}: Props) {
return (
<A
href={`https://github.com/facebook/react-native/blob/${getTemplateBranchNameForCurrentVersion()}/${href.startsWith('/') ? href.slice(1) : href}`}
{...rest}>
{children}
</A>
);
}
4 changes: 3 additions & 1 deletion website/versioned_docs/version-0.80/strict-typescript-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ id: strict-typescript-api
title: Strict TypeScript API (opt in)
---

import RNRepoLink from '@site/core/RNRepoLink';

The Strict TypeScript API is a preview of our future, stable JavaScript API for React Native.

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.
Expand Down Expand Up @@ -178,7 +180,7 @@ In the new types, every optional prop will be typed as `type | undefined`.

### Removal of some deprecated types

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.
All types listed in <RNRepoLink href="/packages/react-native/types/public/DeprecatedPropertiesAlias.d.ts">`DeprecatedPropertiesAlias.d.ts`</RNRepoLink> are inaccessible under the Strict API.

### Removal of leftover component props

Expand Down
4 changes: 3 additions & 1 deletion website/versioned_docs/version-0.81/strict-typescript-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ id: strict-typescript-api
title: Strict TypeScript API (opt in)
---

import RNRepoLink from '@site/core/RNRepoLink';

The Strict TypeScript API is a preview of our future, stable JavaScript API for React Native.

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.
Expand Down Expand Up @@ -178,7 +180,7 @@ In the new types, every optional prop will be typed as `type | undefined`.

### Removal of some deprecated types

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.
All types listed in <RNRepoLink href="/packages/react-native/types/public/DeprecatedPropertiesAlias.d.ts">`DeprecatedPropertiesAlias.d.ts`</RNRepoLink> are inaccessible under the Strict API.

### Removal of leftover component props

Expand Down
4 changes: 3 additions & 1 deletion website/versioned_docs/version-0.82/strict-typescript-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ id: strict-typescript-api
title: Strict TypeScript API (opt in)
---

import RNRepoLink from '@site/core/RNRepoLink';

The Strict TypeScript API is a preview of our future, stable JavaScript API for React Native.

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.
Expand Down Expand Up @@ -178,7 +180,7 @@ In the new types, every optional prop will be typed as `type | undefined`.

### Removal of some deprecated types

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.
All types listed in <RNRepoLink href="/packages/react-native/types/public/DeprecatedPropertiesAlias.d.ts">`DeprecatedPropertiesAlias.d.ts`</RNRepoLink> are inaccessible under the Strict API.

### Removal of leftover component props

Expand Down