React native web platform utils and helpers
npm install @rnw-community/platformPlatform specific helpers and utils for react native web.


Global constants for simple identifying of the platform:
- isWeb
- isIOS
- isAndroid
- isMobile - IOS or Android
Simple platform-specific styling helpers:
- webStyles(style)
- androidStyles(style)
- iosStyles(style)
- iosStyles(style)
- mobileStyles(style)
Example usage:
``ts
import { StyleSheet } from 'react-native';
import { webStyles, androidStyles } from '@rnw-community/platform';
export const Styles = StyleSheet.create({
root: {
width: 200,
...webStyles({
width: 400,
}),
...androidStyles({
paddingBottom: 5,
}),
},
});
`
Generic getter of environment variable value supporting web and native platforms. Works using react-native-confignative
on platform, uses node process on web platform.
Example usage:
`ts
import { getEnv } from '@rnw-community/platform';
const myEnvVar = getEnv('ENV_NAME');
``
This library is licensed under The MIT License.