1 Star 0 Fork 0

789/rnTest

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
App.js 1.16 KB
一键复制 编辑 原始数据 按行查看 历史
wxjaa 提交于 2017-11-26 20:43 +08:00 . frist
/**
* Sample React Native App
* https://github.com/facebook/react-native
* @flow
*/
import React, {Component} from 'react';
import {
StyleSheet,
Text,
View
} from 'react-native';
import MainScreen from './views/test/MainScreen'
export default class App extends Component<{}> {
constructor(props) {
super(props);
this.state = {
remove: false,
}
}
render() {
let view = this.state.remove ? null : <MainScreen/>
let text = this.state.remove ? '让他复活' : '干掉他'
return (
<View style={styles.container}>
<Text onPress={() => {
this.setState({remove: !this.state.remove})
}}>{text}</Text>
{view}
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#F5FCFF',
},
welcome: {
fontSize: 20,
textAlign: 'center',
margin: 10,
},
instructions: {
textAlign: 'center',
color: '#333333',
marginBottom: 5,
},
});
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/wxjaa/rnTest.git
git@gitee.com:wxjaa/rnTest.git
wxjaa
rnTest
rnTest
master

搜索帮助