mirror of
https://github.com/zhigang1992/react-native-web.git
synced 2026-04-24 04:25:27 +08:00
37 lines
796 B
JavaScript
37 lines
796 B
JavaScript
import StyleSheet from '../StyleSheet';
|
|
import View from '../../components/View';
|
|
import React, { Component, PropTypes } from 'react';
|
|
|
|
class ReactNativeApp extends Component {
|
|
static propTypes = {
|
|
initialProps: PropTypes.object,
|
|
rootComponent: PropTypes.any.isRequired,
|
|
rootTag: PropTypes.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;
|