mirror of
https://github.com/zhigang1992/react-native-web.git
synced 2026-04-22 19:58:25 +08:00
Fixes dozens of Flow errors; adds type annotations; marks more files for Flow type checking. Fixes a bug in 'AppState'. 15 Flow errors remaining. Several React Native files are still not type checked (e.g., PanResponder, Touchables) Ref #465
42 lines
815 B
JavaScript
42 lines
815 B
JavaScript
/**
|
|
* @flow
|
|
*/
|
|
|
|
import StyleSheet from '../StyleSheet';
|
|
import View from '../../components/View';
|
|
import { any, object } from 'prop-types';
|
|
import React, { Component } from 'react';
|
|
|
|
class ReactNativeApp extends Component {
|
|
static propTypes = {
|
|
initialProps: object,
|
|
rootComponent: any.isRequired,
|
|
rootTag: any
|
|
};
|
|
|
|
render() {
|
|
const { initialProps, rootComponent: RootComponent, rootTag } = this.props;
|
|
|
|
return (
|
|
<View style={styles.appContainer}>
|
|
<RootComponent {...initialProps} rootTag={rootTag} />
|
|
</View>
|
|
);
|
|
}
|
|
}
|
|
|
|
const styles = StyleSheet.create({
|
|
/**
|
|
* Ensure that the application covers the whole screen.
|
|
*/
|
|
appContainer: {
|
|
position: 'absolute',
|
|
left: 0,
|
|
top: 0,
|
|
right: 0,
|
|
bottom: 0
|
|
}
|
|
});
|
|
|
|
module.exports = ReactNativeApp;
|