Skip to content

Commit f898bb6

Browse files
anku255facebook-github-bot
authored andcommitted
Fix alert screen crash in android in RNTester app (#29150)
Summary: fixes - MLH-Fellowship#21 [Reviewed by jevakallio](MLH-Fellowship#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: #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
1 parent 320398a commit f898bb6

2 files changed

Lines changed: 15 additions & 23 deletions

File tree

RNTester/js/examples/Alert/AlertExample.js

Lines changed: 14 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ const {
1818
View,
1919
} = require('react-native');
2020

21-
const RNTesterBlock = require('../../components/RNTesterBlock');
22-
2321
// corporate ipsum > lorem ipsum
2422
const alertMessage =
2523
'Credibly reintermediate next-generation potentialities after goal-oriented ' +
@@ -125,22 +123,6 @@ class SimpleAlertExampleBlock extends React.Component<Props> {
125123
}
126124
}
127125

128-
class AlertExample extends React.Component {
129-
static title = 'Alert';
130-
131-
static description =
132-
'Alerts display a concise and informative message ' +
133-
'and prompt the user to make a decision.';
134-
135-
render() {
136-
return (
137-
<RNTesterBlock title={'Alert'}>
138-
<SimpleAlertExampleBlock />
139-
</RNTesterBlock>
140-
);
141-
}
142-
}
143-
144126
const styles = StyleSheet.create({
145127
wrapper: {
146128
borderRadius: 5,
@@ -152,7 +134,17 @@ const styles = StyleSheet.create({
152134
},
153135
});
154136

155-
module.exports = {
156-
AlertExample,
157-
SimpleAlertExampleBlock,
158-
};
137+
exports.title = 'Alert';
138+
exports.description =
139+
'Alerts display a concise and informative message ' +
140+
'and prompt the user to make a decision.';
141+
exports.examples = [
142+
{
143+
title: 'Alerts',
144+
render(): React.Node {
145+
return <SimpleAlertExampleBlock />;
146+
},
147+
},
148+
];
149+
150+
exports.SimpleAlertExampleBlock = SimpleAlertExampleBlock;

RNTester/js/utils/RNTesterList.android.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ const APIExamples: Array<RNTesterExample> = [
122122
},
123123
{
124124
key: 'AlertExample',
125-
module: require('../examples/Alert/AlertExample').AlertExample,
125+
module: require('../examples/Alert/AlertExample'),
126126
},
127127
{
128128
key: 'AnimatedExample',

0 commit comments

Comments
 (0)