Skip to content

Commit a99d805

Browse files
committed
Added web support to legacy test
1 parent 690911b commit a99d805

File tree

5 files changed

+1413
-9
lines changed

5 files changed

+1413
-9
lines changed

Diff for: .gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,5 @@ buck-out/
4747

4848
# Editor config
4949
.vscode
50+
.expo
51+
/web-build

Diff for: app.json

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"expo": {
3+
"entryPoint": "./example/index"
4+
}
5+
}

Diff for: example/index.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,13 @@
88
* @flow
99
*/
1010

11-
import {AppRegistry} from 'react-native';
11+
import {AppRegistry, Platform} from 'react-native';
1212
import App from './App';
1313
import {name as appName} from './app.json';
1414

1515
AppRegistry.registerComponent(appName, () => App);
16+
17+
if (Platform.OS === 'web') {
18+
const rootTag = document.getElementById('root');
19+
AppRegistry.runApplication(appName, {rootTag});
20+
}

Diff for: package.json

+10-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
"types": "./types/index.d.ts",
66
"main": "./lib/index.js",
77
"author": "Krzysztof Borowy <[email protected]>",
8-
"contributors": [],
8+
"contributors": [
9+
"Evan Bacon <[email protected]> (https://github.com/evanbacon)"
10+
],
911
"homepage": "https://github.com/react-native-community/react-native-async-storage#readme",
1012
"license": "MIT",
1113
"keywords": [
@@ -23,6 +25,7 @@
2325
"start": "node node_modules/react-native/local-cli/cli.js start",
2426
"start:android": "react-native run-android --root example/",
2527
"start:ios": "react-native run-ios --project-path example/ios --scheme AsyncStorageExample",
28+
"start:web": "expo start:web",
2629
"start:macos": "node node_modules/react-native-macos/local-cli/cli.js start --use-react-native-macos",
2730
"build:e2e:ios": "detox build -c ios",
2831
"build:e2e:android": "detox build -c android",
@@ -38,19 +41,25 @@
3841
"react": "^16.8",
3942
"react-native": ">=0.59"
4043
},
44+
"dependencies": {
45+
"deep-assign": "^3.0.0"
46+
},
4147
"devDependencies": {
4248
"@babel/core": "7.4.5",
4349
"@babel/runtime": "7.4.5",
4450
"@react-native-community/eslint-config": "0.0.2",
4551
"babel-jest": "24.8.0",
4652
"babel-plugin-module-resolver": "3.1.3",
4753
"detox": "12.6.1",
54+
"expo": "36.0.2",
4855
"eslint": "5.1.0",
4956
"flow-bin": "0.92.0",
5057
"jest": "24.8.0",
5158
"metro-react-native-babel-preset": "0.54.1",
5259
"react": "16.6.3",
60+
"react-dom": "16.6.3",
5361
"react-native": "0.59.10",
62+
"react-native-web": "~0.12.0",
5463
"react-native-macos": "0.60.0-microsoft.50",
5564
"react-test-renderer": "16.8.3"
5665
},

0 commit comments

Comments
 (0)