未定义不是函数(评估“ addListener”)

时间:2019-09-10 07:11:49

标签: react-native

我在运行react-native run-android时遇到问题,该程序不想出现并弹出未定义的错误。

index.js

import React from 'react';
import { AppRegistry } from 'react-native';
import { Provider } from 'react-redux';
import { createStore, applyMiddleware } from 'redux';
import thunk from 'redux-thunk'

import AppReducer from './src/reducers';
import AppWithNavigationState from './src/navigators/AppNavigator'

const middleware = [ thunk ];

class magical extends React.Component {
  store = createStore(AppReducer, applyMiddleware(...middleware));

  render() {
    return (
      <Provider store={this.store}>
        <AppWithNavigationState />
      </Provider>
    );
  }
}

AppRegistry.registerComponent('magical', () => magical);

0 个答案:

没有答案