Ios React本机SocketProtocol错误和TimeoutError

Ios React本机SocketProtocol错误和TimeoutError,ios,websocket,react-native,Ios,Websocket,React Native,我似乎一点也不明白。每当我打开React本机应用程序时,都会出现这些错误。我发现最好的一点是,这与应用程序的捆绑方式有关。任何帮助都将受到极大的感谢和支持!谢谢 来自xCode的错误 2016-06-16 17:21:50.160 [warn][tid:com.facebook.react.JavaScript] [TimeoutError: Event response for 'login' timed out] 2016-06-16 17:21:51.580 [warn][tid:com

我似乎一点也不明白。每当我打开React本机应用程序时,都会出现这些错误。我发现最好的一点是,这与应用程序的捆绑方式有关。任何帮助都将受到极大的感谢和支持!谢谢

来自xCode的错误

2016-06-16 17:21:50.160 [warn][tid:com.facebook.react.JavaScript] [TimeoutError: Event response for 'login' timed out]
2016-06-16 17:21:51.580 [warn][tid:com.facebook.react.JavaScript] [SocketProtocolError: Socket hung
版本

   "react": "^15.1.0",  
   "react-native": "^0.27.2"  
   ... along with about 30 others
ios-AppDelegate.m

 jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/index.ios.bundle?platform=ios&dev=true"];

  /**
   * OPTION 2
   * Load from pre-bundled file on disk. The static bundle is automatically
   * generated by the "Bundle React Native code and images" build step when
   * running the project on an actual device or running the project on the
   * simulator in the "Release" build configuration.
   */

  // jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];


  RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
                                                  moduleName:@"MyApp"
                                                  initialProperties:nil
                                                  launchOptions:launchOptions];

过了很长一段时间,我意识到这实际上是我的React开发工具和HMR。我必须将我的商店配置更新为以下内容:

旧------(下)

新标准(见下文)

    import Immutable from 'immutable';
    import { Platform } from 'react-native';
    import { createStore, applyMiddleware, compose } from 'redux';
    import thunk from 'redux-thunk';
    import reducer from '../reducers';

    const middlewares = [thunk]; 

let enhancer;
if (__DEV__) {
  const installDevTools = require('immutable-devtools');
  installDevTools(Immutable);

  const devTools = require('remote-redux-devtools');
  enhancer = compose(
    applyMiddleware(...middlewares),
    devTools({
      name: Platform.OS,
      hostname: 'localhost',
      port: 5678
    })
  );
} else {
  enhancer = applyMiddleware(...middlewares);
}
import Immutable from 'immutable';
import { Platform } from 'react-native';
import { createStore, applyMiddleware, compose } from 'redux';
import thunk from 'redux-thunk';
import reducer from '../reducers';

const middlewares = [thunk];

let enhancer = applyMiddleware(...middlewares);

export default function configureStore(initialState) {
  const store = createStore(reducer, initialState, enhancer);
  if (module.hot) {
    module.hot.accept(() => {
      store.replaceReducer(require('../reducers').default);
    });
  }
  return store;
}