forked from software-mansion/react-native-gesture-handler
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move REACT_NATIVE_VERSION to native-only code
Fixes software-mansion#2660
- Loading branch information
Chris Coomber
committed
Nov 3, 2023
1 parent
b0986c3
commit 4d48403
Showing
4 changed files
with
16 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import pack from 'react-native/package.json'; | ||
|
||
const [majorStr, minorStr] = pack.version.split('.'); | ||
const REACT_NATIVE_VERSION = { | ||
major: parseInt(majorStr, 10), | ||
minor: parseInt(minorStr, 10), | ||
}; | ||
|
||
export function getReactNativeVersion() { | ||
return REACT_NATIVE_VERSION; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export function getReactNativeVersion() { | ||
throw new Error('getReactNativeVersion is not supported on web'); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters