我正在尝试使用redux-saga从我的API中获取一些数据。不幸的是,它失败了,我收到了Uncaught TypeError: this.props.fetchData is not a function。this.props.someInfo也是未定义的。因为我正在做一些控制台日志,所以我看到没有输入函数getData。我认为这意味着触发操作存在问题。不幸的是,我不知道哪里可能出了问题,也不知道如何修复。
createStore.js
import {createStore, applyMiddleware, compose} from 'redux';
import cr
我试图在我的反应项目中使用redux-saga,但是redux-saga函数没有被调用。toggleLoginModal操作在access.actions.js中被调用,但是toggleLoginModal在access.sagas.js中没有被调用。
Header.jsx
import React, { Component } from 'react';
import { withRouter } from 'react-router';
import accessActions from 'actions/access.actions';
i
我正试图理解react和redux-saga,而我面临的问题是,每当我试图在一个功能组件的useEffect钩子中分派任何状态变化的动作时,例如,使用useDispatch钩子,应用程序就会结冰。现在useSelector运行得很好,我可以得到这个州。
我试过阅读redux-saga文档中关于应用程序冻结的故障排除部分,其中说您必须采取行动,但我已经这样做了:
import { put } from 'redux-saga/effects';
import * as actions from '../actions/index';
export functi
试图理解Redux-Saga的React。所面临的问题是在尝试调用API时。尽管配置了API,但是应用程序使用它自己的本地calendar.js文件中存在的相同静态数据。 我正在尝试使用API,而不是使用静态硬编码数据。 api_helper.js import axios from "axios"
import accessToken from "./jwt-token-access/accessToken"
const token = accessToken
//url to get data is : https://jsonplaceholder.