Skip to content

Updated Playground example to display screen dimensions issue #51204

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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
10 changes: 8 additions & 2 deletions packages/rn-tester/js/examples/Playground/RNTesterPlayground.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,19 @@ import type {RNTesterModuleExample} from '../../types/RNTesterTypes';

import RNTesterText from '../../components/RNTesterText';
import * as React from 'react';
import {StyleSheet, View} from 'react-native';
import {Dimensions, StyleSheet, View} from 'react-native';

function Playground() {
const screenWithoutStatusBar = Dimensions.get('window').height;
const screenWithStatusBar = Dimensions.get('screen').height;
return (
<View style={styles.container}>
<RNTesterText>
Edit "RNTesterPlayground.js" to change this file
{`Dimensions.get('window').height: ${screenWithoutStatusBar}`}
{'\n'}
{`Dimensions.get('screen').height: ${screenWithStatusBar}`}
{'\n\n'}
{'Note these two should not be equal on iOS devices with a status bar.'}
</RNTesterText>
</View>
);
Expand Down
Loading