@amazon-devices/expo-constantsは、アプリのインストールのライフタイムを通じて変化しないシステム情報を提供します。
インストール
package.jsonファイルにJavaScriptライブラリの依存関係を追加します。該当するReact Nativeバージョンのタブを選択してください。
- React Native 0.72
- React Native 0.83
npm installコマンドを使用して依存関係を再インストールします。
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
@amazon-devices/expo-constantsは、アプリのインストールのライフタイムを通じて変化しないシステム情報を提供します。
@amazon-devices/expo-constantsは、アプリのインストールのライフタイムを通じて変化しないシステム情報を提供します。
package.jsonファイルにJavaScriptライブラリの依存関係を追加します。該当するReact Nativeバージョンのタブを選択してください。dependencies: {
...
"@amazon-devices/expo-constants": "~2.0.0",
"expo": "~50.0.0",
...
}
dependencies: {
...
"@amazon-devices/expo-constants": "~3.0.0",
"expo": "~50.0.0",
...
}
npm installコマンドを使用して依存関係を再インストールします。import React from 'react';
import Constants from '@amazon-devices/expo-constants';
import {StyleSheet, Text, View} from 'react-native';
export const App = () => {
return (
<View style={styles.container}>
<Text style={styles.text}>
isHeadless: {String(Constants.isHeadless)}
</Text>
<Text style={styles.text}>
statusBarHeight: {Constants.statusBarHeight}
</Text>
<Text style={styles.text}>
systemFonts: {Constants.systemFonts.join(', ')}
</Text>
</View>
);
};
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: 'white',
justifyContent: 'center',
alignItems: 'center',
},
text: {
fontSize: 30,
color: 'black',
},
});
このページは役に立ちましたか?
