Skip to content

Commit 0f52b7c

Browse files
committed
fix: get version from native modules instead of haste. closes #642
1 parent 9eb0c4a commit 0f52b7c

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/components/Switch.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,12 @@
22

33
import * as React from 'react';
44
import { grey400, grey800, grey50, white, black } from '../styles/colors';
5-
import { Switch as NativeSwitch, Platform } from 'react-native';
5+
import { Switch as NativeSwitch, Platform, NativeModules } from 'react-native';
66
import setColor from 'color';
77
import { withTheme } from '../core/theming';
88
import type { Theme } from '../types';
99

10-
// eslint-disable-next-line import/no-unresolved
11-
const { version } = require('ReactNativeVersion');
10+
const version = NativeModules.PlatformConstants.reactNativeVersion;
1211

1312
type Props = React.ElementProps<NativeSwitch> & {
1413
/**

0 commit comments

Comments
 (0)