Skip to content

Commit

Permalink
Fix RNTester Not Resizing Examples on Rotation/Resize (#30376)
Browse files Browse the repository at this point in the history
Summary:
Fixes #30325

After the RNTester redesign, a style started globally caching screen width. This isn't needed, but means that width is incorrect if the device is rotated, or a window is resized. Rely on default layout which will be 100% width instead.
## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->

[Internal] [Fixed] - Fix RNTester Not Resizing Examples on Rotation/Resize

Pull Request resolved: #30376

Test Plan: Tested viewing an example and rotating the device in iOS simulator

Reviewed By: rickhanlonii

Differential Revision: D25098642

Pulled By: appden

fbshipit-source-id: 9acdb656da7de9fda05f6091b36f8d9aa2155524
  • Loading branch information
NickGerleman authored and facebook-github-bot committed Dec 3, 2020
1 parent 2e6eea8 commit 5407353
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions packages/rn-tester/js/components/ExamplePage.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
'use strict';

import * as React from 'react';
import {StyleSheet, View, Text, Dimensions} from 'react-native';
import {StyleSheet, View, Text} from 'react-native';

type Props = $ReadOnly<{|
children?: React.Node,
Expand All @@ -22,7 +22,6 @@ type Props = $ReadOnly<{|
android?: ?boolean,
|}>;

const ScreenWidth = Dimensions.get('window').width;
import {RNTesterThemeContext} from './RNTesterTheme';

export default function ExamplePage(props: Props): React.Node {
Expand Down Expand Up @@ -76,7 +75,6 @@ const styles = StyleSheet.create({
justifyContent: 'flex-end',
},
examplesContainer: {
width: ScreenWidth,
flexGrow: 1,
},
description: {
Expand Down

0 comments on commit 5407353

Please sign in to comment.