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
6 changes: 6 additions & 0 deletions docs/components-and-apis.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,12 @@ These components may be useful for certain applications. For an exhaustive list
<p>Provides access to the device pixel density.</p>
</a>
</div>
<div className="component">
<a href="./reactnativeversion">
<h3>ReactNativeVersion</h3>
<p>Exposes the resolved React Native package version on the JS side.</p>
</a>
</div>
<div className="component">
<a href="./refreshcontrol">
<h3>RefreshControl</h3>
Expand Down
83 changes: 83 additions & 0 deletions docs/reactnativeversion.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
---
id: reactnativeversion
title: ReactNativeVersion
---

```tsx
import {ReactNativeVersion} from 'react-native';
```

The `ReactNativeVersion` API exposes the version of the resolved `react-native` package on JS side. Apps and libraries can use it to check compatibility or enable version-specific behavior.

:::note

Also, we have [`Platform.constants.reactNativeVersion`](platform#constants) in our public API already. **However**, this is the per-platform _**native-reported**_ React Native version.

:::

## Example

```tsx
import {ReactNativeVersion} from 'react-native';

const version = ReactNativeVersion.getVersionString(); // 0.88.1
const {major, minor, patch, prerelease} = ReactNativeVersion;
major; // 0
minor; // 88
patch; // 1
prerelease; // null
```

---

# Reference

## Properties

### `major`

```tsx
static major: number;
```

The major version number of the resolved `react-native` package.

---

### `minor`

```tsx
static minor: number;
```

The minor version number of the resolved `react-native` package.

---

### `patch`

```tsx
static patch: number;
```

The patch version number of the resolved `react-native` package.

---

### `prerelease`

```tsx
static prerelease: string | null;
```

The prerelease tag for the resolved `react-native` package, or `null` for stable releases.

## Methods

### `getVersionString()`

```tsx
static getVersionString(): string;
```

Returns the full version string in the format `major.minor.patch` or `major.minor.patch-prerelease`.
1 change: 1 addition & 0 deletions website/sidebars.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ export default {
'pixelratio',
'platform',
'platformcolor',
'reactnativeversion',
'roottag',
'share',
'stylesheet',
Expand Down
6 changes: 6 additions & 0 deletions website/versioned_docs/version-0.82/components-and-apis.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,12 @@ These components may be useful for certain applications. For an exhaustive list
<p>Provides access to the device pixel density.</p>
</a>
</div>
<div className="component">
<a href="./reactnativeversion">
<h3>ReactNativeVersion</h3>
<p>Exposes the resolved React Native package version on the JS side.</p>
</a>
</div>
<div className="component">
<a href="./refreshcontrol">
<h3>RefreshControl</h3>
Expand Down
83 changes: 83 additions & 0 deletions website/versioned_docs/version-0.82/reactnativeversion.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
---
id: reactnativeversion
title: ReactNativeVersion
---

```tsx
import {ReactNativeVersion} from 'react-native';
```

The `ReactNativeVersion` API exposes the version of the resolved `react-native` package on JS side. Apps and libraries can use it to check compatibility or enable version-specific behavior.

:::note

Also, we have [`Platform.constants.reactNativeVersion`](platform#constants) in our public API already. **However**, this is the per-platform _**native-reported**_ React Native version.

:::

## Example

```tsx
import {ReactNativeVersion} from 'react-native';

const version = ReactNativeVersion.getVersionString(); // 0.82.1
const {major, minor, patch, prerelease} = ReactNativeVersion;
major; // 0
minor; // 82
patch; // 1
prerelease; // null
```

---

# Reference

## Properties

### `major`

```tsx
static major: number;
```

The major version number of the resolved `react-native` package.

---

### `minor`

```tsx
static minor: number;
```

The minor version number of the resolved `react-native` package.

---

### `patch`

```tsx
static patch: number;
```

The patch version number of the resolved `react-native` package.

---

### `prerelease`

```tsx
static prerelease: string | null;
```

The prerelease tag for the resolved `react-native` package, or `null` for stable releases.

## Methods

### `getVersionString()`

```tsx
static getVersionString(): string;
```

Returns the full version string in the format `major.minor.patch` or `major.minor.patch-prerelease`.
6 changes: 6 additions & 0 deletions website/versioned_docs/version-0.83/components-and-apis.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,12 @@ These components may be useful for certain applications. For an exhaustive list
<p>Provides access to the device pixel density.</p>
</a>
</div>
<div className="component">
<a href="./reactnativeversion">
<h3>ReactNativeVersion</h3>
<p>Exposes the resolved React Native package version on the JS side.</p>
</a>
</div>
<div className="component">
<a href="./refreshcontrol">
<h3>RefreshControl</h3>
Expand Down
83 changes: 83 additions & 0 deletions website/versioned_docs/version-0.83/reactnativeversion.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
---
id: reactnativeversion
title: ReactNativeVersion
---

```tsx
import {ReactNativeVersion} from 'react-native';
```

The `ReactNativeVersion` API exposes the version of the resolved `react-native` package on JS side. Apps and libraries can use it to check compatibility or enable version-specific behavior.

:::note

Also, we have [`Platform.constants.reactNativeVersion`](platform#constants) in our public API already. **However**, this is the per-platform _**native-reported**_ React Native version.

:::

## Example

```tsx
import {ReactNativeVersion} from 'react-native';

const version = ReactNativeVersion.getVersionString(); // 0.83.10
const {major, minor, patch, prerelease} = ReactNativeVersion;
major; // 0
minor; // 83
patch; // 10
prerelease; // null
```

---

# Reference

## Properties

### `major`

```tsx
static major: number;
```

The major version number of the resolved `react-native` package.

---

### `minor`

```tsx
static minor: number;
```

The minor version number of the resolved `react-native` package.

---

### `patch`

```tsx
static patch: number;
```

The patch version number of the resolved `react-native` package.

---

### `prerelease`

```tsx
static prerelease: string | null;
```

The prerelease tag for the resolved `react-native` package, or `null` for stable releases.

## Methods

### `getVersionString()`

```tsx
static getVersionString(): string;
```

Returns the full version string in the format `major.minor.patch` or `major.minor.patch-prerelease`.
6 changes: 6 additions & 0 deletions website/versioned_docs/version-0.84/components-and-apis.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,12 @@ These components may be useful for certain applications. For an exhaustive list
<p>Provides access to the device pixel density.</p>
</a>
</div>
<div className="component">
<a href="./reactnativeversion">
<h3>ReactNativeVersion</h3>
<p>Exposes the resolved React Native package version on the JS side.</p>
</a>
</div>
<div className="component">
<a href="./refreshcontrol">
<h3>RefreshControl</h3>
Expand Down
83 changes: 83 additions & 0 deletions website/versioned_docs/version-0.84/reactnativeversion.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
---
id: reactnativeversion
title: ReactNativeVersion
---

```tsx
import {ReactNativeVersion} from 'react-native';
```

The `ReactNativeVersion` API exposes the version of the resolved `react-native` package on JS side. Apps and libraries can use it to check compatibility or enable version-specific behavior.

:::note

Also, we have [`Platform.constants.reactNativeVersion`](platform#constants) in our public API already. **However**, this is the per-platform _**native-reported**_ React Native version.

:::

## Example

```tsx
import {ReactNativeVersion} from 'react-native';

const version = ReactNativeVersion.getVersionString(); // 0.84.1
const {major, minor, patch, prerelease} = ReactNativeVersion;
major; // 0
minor; // 84
patch; // 1
prerelease; // null
```

---

# Reference

## Properties

### `major`

```tsx
static major: number;
```

The major version number of the resolved `react-native` package.

---

### `minor`

```tsx
static minor: number;
```

The minor version number of the resolved `react-native` package.

---

### `patch`

```tsx
static patch: number;
```

The patch version number of the resolved `react-native` package.

---

### `prerelease`

```tsx
static prerelease: string | null;
```

The prerelease tag for the resolved `react-native` package, or `null` for stable releases.

## Methods

### `getVersionString()`

```tsx
static getVersionString(): string;
```

Returns the full version string in the format `major.minor.patch` or `major.minor.patch-prerelease`.
Loading