Fix alert screen crash in android in RNTester app (#29150)

Summary:
fixes - https://github.com/MLH-Fellowship/react-native/issues/21

[Reviewed by jevakallio](https://github.com/MLH-Fellowship/react-native/pull/22)

## Changelog

Before:

![image](https://user-images.githubusercontent.com/22813027/84471321-ba63bf00-aca2-11ea-92c0-3b43a8bdd28a.png)

After:

<img width="305" alt="Screenshot 2020-06-12 at 11 49 31 AM" src="https://user-images.githubusercontent.com/22813027/84471351-c8b1db00-aca2-11ea-9844-2b06da36e590.png">
Pull Request resolved: https://github.com/facebook/react-native/pull/29150

Test Plan:
1. Run the RNTester app locally on both android and iOS.
2. Open the Alert API screen.
3. Alert examples should be visible and functional in both android and iOS.

Screenshot for both android and iOS screens-

<img width="688" alt="Screenshot 2020-06-12 at 11 52 21 AM" src="https://user-images.githubusercontent.com/22813027/84471544-2d6d3580-aca3-11ea-9142-5f31a3daaf4e.png">

Reviewed By: cpojer

Differential Revision: D22067670

Pulled By: rickhanlonii

fbshipit-source-id: e7c43b77a30ae2e258303ce84f7fc4dee63776e6
This commit is contained in:
Ankit Tiwari
2020-07-12 19:57:12 -07:00
committed by Facebook GitHub Bot
parent 320398afe5
commit f898bb65fa
2 changed files with 15 additions and 23 deletions
+14 -22
View File
@@ -18,8 +18,6 @@ const {
View,
} = require('react-native');
const RNTesterBlock = require('../../components/RNTesterBlock');
// corporate ipsum > lorem ipsum
const alertMessage =
'Credibly reintermediate next-generation potentialities after goal-oriented ' +
@@ -125,22 +123,6 @@ class SimpleAlertExampleBlock extends React.Component<Props> {
}
}
class AlertExample extends React.Component {
static title = 'Alert';
static description =
'Alerts display a concise and informative message ' +
'and prompt the user to make a decision.';
render() {
return (
<RNTesterBlock title={'Alert'}>
<SimpleAlertExampleBlock />
</RNTesterBlock>
);
}
}
const styles = StyleSheet.create({
wrapper: {
borderRadius: 5,
@@ -152,7 +134,17 @@ const styles = StyleSheet.create({
},
});
module.exports = {
AlertExample,
SimpleAlertExampleBlock,
};
exports.title = 'Alert';
exports.description =
'Alerts display a concise and informative message ' +
'and prompt the user to make a decision.';
exports.examples = [
{
title: 'Alerts',
render(): React.Node {
return <SimpleAlertExampleBlock />;
},
},
];
exports.SimpleAlertExampleBlock = SimpleAlertExampleBlock;
+1 -1
View File
@@ -122,7 +122,7 @@ const APIExamples: Array<RNTesterExample> = [
},
{
key: 'AlertExample',
module: require('../examples/Alert/AlertExample').AlertExample,
module: require('../examples/Alert/AlertExample'),
},
{
key: 'AnimatedExample',