# oschina_for_react_native
**Repository Path**: xianhe005/oschina_for_react_native
## Basic Information
- **Project Name**: oschina_for_react_native
- **Description**: oschina application client for react native,想要IOS版的自行脑补
- **Primary Language**: JavaScript
- **License**: MIT
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 7
- **Created**: 2016-12-19
- **Last Updated**: 2020-12-19
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
##oschina_for_react_native
纯粹学习之作,里面只有Android代码,IOS没有适配,等我什么时候买了肾机再考虑适配IOS.
##学习资料
 -[React Native官网](https://facebook.github.io/react-native/) 官方的,你懂的    
 -[React Native中文网](http://reactnative.cn/docs/0.22/getting-started.html) 与官方文档同步,不用担心文档落后问题     
 -[React](http://reactjs.cn/react/docs/getting-started.html) React必学!
##效果图







 ##Note
使用之前,请修改一下BackAndroid.android.js的源代码的RCTDeviceEventEmitter.addListener()这个function
以前的:
```
RCTDeviceEventEmitter.addListener(DEVICE_BACK_EVENT, function() {
  var backPressSubscriptions = new Set(_backPressSubscriptions);
  var invokeDefault = true;
  backPressSubscriptions.forEach((subscription) => {
    if (subscription()) {
      invokeDefault = false;
    }
  });
  if (invokeDefault) {
    BackAndroid.exitApp();
  }
});
```
修改后
```
RCTDeviceEventEmitter.addListener(DEVICE_BACK_EVENT, function() {
  var backPressSubscriptions = new Set(_backPressSubscriptions);
  var invokeDefault = true;
  for(let subscriber of backPressSubscriptions.keys()){
    if (subscriber()){
      invokeDefault = false;
      break;
    }
  }
  if (invokeDefault) {
    BackAndroid.exitApp();
  }
});
```
##Note
使用之前,请修改一下BackAndroid.android.js的源代码的RCTDeviceEventEmitter.addListener()这个function
以前的:
```
RCTDeviceEventEmitter.addListener(DEVICE_BACK_EVENT, function() {
  var backPressSubscriptions = new Set(_backPressSubscriptions);
  var invokeDefault = true;
  backPressSubscriptions.forEach((subscription) => {
    if (subscription()) {
      invokeDefault = false;
    }
  });
  if (invokeDefault) {
    BackAndroid.exitApp();
  }
});
```
修改后
```
RCTDeviceEventEmitter.addListener(DEVICE_BACK_EVENT, function() {
  var backPressSubscriptions = new Set(_backPressSubscriptions);
  var invokeDefault = true;
  for(let subscriber of backPressSubscriptions.keys()){
    if (subscriber()){
      invokeDefault = false;
      break;
    }
  }
  if (invokeDefault) {
    BackAndroid.exitApp();
  }
});
```