Skip to content

Commit e6ea2c8

Browse files
committed
Use the same App.js between web and not in web template
1 parent 49b665f commit e6ea2c8

File tree

6 files changed

+13
-14
lines changed

6 files changed

+13
-14
lines changed

react-native-scripts/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-scripts",
3-
"version": "1.11.1",
3+
"version": "1.2.0-alpha.2",
44
"description": "Configuration and scripts for Create React Native App.",
55
"license": "BSD-3-Clause",
66
"keywords": [
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import Expo from 'expo';
2+
import App from '../../../../src/App';
3+
import React, { Component } from 'react';
4+
import { View } from 'react-native';
5+
6+
if (process.env.NODE_ENV === 'development') {
7+
Expo.KeepAwake.activate();
8+
}
9+
10+
Expo.registerRootComponent(App);

react-native-scripts/src/scripts/init.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ https://github.com/npm/npm/issues/16991
101101
};
102102

103103
if (arg['with-web-support']) {
104+
appPackage.main = './node_modules/react-native-scripts/build/bin/crna-entry-web.js';
104105
Object.assign(appPackage.scripts, {
105106
web: 'webpack-dev-server -d --config ./webpack.config.js --inline --hot --colors --content-base public/',
106107
build: 'NODE_ENV=production webpack -p --config ./webpack.config.js',

react-native-scripts/template-with-web/App.js

Lines changed: 0 additions & 3 deletions
This file was deleted.

react-native-scripts/template-with-web/App.test.js

Lines changed: 0 additions & 9 deletions
This file was deleted.

react-native-scripts/template-with-web/src/App.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default class App extends React.Component {
55
render() {
66
return (
77
<View style={styles.container}>
8-
<Text>Open up App.js to start working on your app!</Text>
8+
<Text>Open up src/App.js to start working on your app!</Text>
99
<Text>Changes you make will automatically reload.</Text>
1010
<Text>Shake your phone to open the developer menu.</Text>
1111
</View>

0 commit comments

Comments
 (0)