Skip to content

Commit e9c0445

Browse files
authored
fix(App): Refactor App render and test (#12)
1 parent 22f53d2 commit e9c0445

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

Diff for: src/App/__tests__/index.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
/** @format */
22

3+
import React from 'react';
34
import renderer from 'react-test-renderer';
45

56
import App from '..';
67

78
test('should render properly', () => {
8-
const tree = renderer.create(App).toJSON();
9+
const tree = renderer.create(<App />).toJSON();
910
expect(tree).toMatchSnapshot();
1011
});

Diff for: src/App/index.js

+2-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
1-
//@flow
2-
31
/**
4-
* React Native Basic App
5-
* https://github.com/facebook/react-native
6-
*
72
* @format
3+
* @flow
84
*/
95

106
import React from 'react';
@@ -42,7 +38,7 @@ const instructions = Platform.select({
4238
android: 'Double tap R on your keyboard to reload,\nShake or press menu button for dev menu',
4339
});
4440

45-
const App = (
41+
const App = () => (
4642
<View style={styles.container}>
4743
<Text style={styles.welcome}>Welcome to React Native!</Text>
4844
<Text style={styles.instructions}>Your App is ready and you already have:</Text>

0 commit comments

Comments
 (0)