小编Dan*_*iel的帖子

Redux Action 未命中Reducer [React]

正如标题所示,我的 React 应用程序遇到问题,我可以点击 Redux Action,但之后就不会点击Reducer。我查看了我过去从事的一个项目,以及这里的几篇文章,但我不确定我的代码有什么问题,导致操作无法命中减速器。我已粘贴下面的代码,但如果我可以提供其他内容,请告诉我。

索引.js:

import React from 'react';
import ReactDom from 'react-dom';
import App from './components/App.jsx';
import { Provider } from 'react-redux';
import { createStore } from 'redux';
import reducer from './reducers/usersRedcuers';
import './index.css';

const store = createStore(reducer);

ReactDom.render(
    <Provider store={store}>
      <App />
    </Provider>, document.getElementById('root')
)
Run Code Online (Sandbox Code Playgroud)

App.jsx 组件:

import React, { Component } from 'react';
import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';

import Auth from '../modules/Auth';
import { login } from '../actions/usersActions';

class …
Run Code Online (Sandbox Code Playgroud)

reactjs redux

3
推荐指数
1
解决办法
2179
查看次数

标签 统计

reactjs ×1

redux ×1