1 Star 0 Fork 10

Tree_Root/GSYGithubAPP

forked from CarGuo/GSYGithubAPP 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
App.js 1.33 KB
一键复制 编辑 原始数据 按行查看 历史
CarGuo 提交于 2019-07-16 16:10 . update
/**
* Sample React Native App
* https://github.com/facebook/react-native
* @flow
*/
import React, {Component} from 'react';
import {View} from 'react-native';
import {Provider} from 'react-redux';
import getRouter from './app/router';
import store from './app/store/'
import {getLanguageCurrent} from './app/utils/actionUtils'
import {changeLocale} from './app/style/i18n'
import {getRefreshHandler} from './app/utils/actionUtils'
import * as Constant from './app/style/constant'
export default class App extends Component<{}> {
constructor() {
super();
this.state = {
store: store,
show: false
};
getLanguageCurrent().then((res) => {
changeLocale(res.language);
this.setState({
show: true
})
});
//切换语言
getRefreshHandler().set(Constant.REFRESH_LANGUAGE, () => {
this.setState({
show: false
});
setTimeout(() => {
this.setState({
show: true
})
}, 500)
})
}
render() {
if (!this.state.show) {
return <View/>
}
return (
<Provider store={this.state.store}>
{getRouter()}
</Provider>
);
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/tree_root/GSYGithubAPP.git
git@gitee.com:tree_root/GSYGithubAPP.git
tree_root
GSYGithubAPP
GSYGithubAPP
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385