Skip to content

Commit f0f92f1

Browse files
committed
Keep apps from sleeping the screen when they're foregrounded in dev mode.
1 parent 44916b8 commit f0f92f1

File tree

1 file changed

+23
-2
lines changed

1 file changed

+23
-2
lines changed
Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,25 @@
1-
import Expo from 'expo';
1+
import Expo, {
2+
Components
3+
} from 'expo';
24
import App from '../../../../App';
5+
import React from 'react';
6+
import {
7+
View
8+
} from 'react-native';
39

4-
Expo.registerRootComponent(App);
10+
// we don't want this to require transformation
11+
class AwakeApp extends React.Component {
12+
render() {
13+
return React.createElement(
14+
View, {
15+
style: {
16+
flex: 1,
17+
}
18+
},
19+
React.createElement(App, null),
20+
React.createElement(Components.KeepAwake, null),
21+
);
22+
}
23+
}
24+
25+
Expo.registerRootComponent(AwakeApp);

0 commit comments

Comments
 (0)