我一直在调试这个程序,但毫无头绪,我逐字逐句地遵循教程,试图制作一个TODO应用程序,但我不知道为什么我会收到这个错误消息。
./src/cuers.js
第12行:“分派”未定义为no-undef
第13行:“分派”未定义为no-undef
components.js
import React from 'react'
class Todo extends React.Component {
render() {
const { todo } = this.props
if (todo.isDone) {
我想使用const dispatch = useAppDispatch()
然后是dispatch(edit(xxxxxxx))
我想要像const edit = useAppDispatch(edit(xxxxxxx))这样的东西
然后简单地在代码中输入edit(xxxxxxx)
但它不起作用。好了!帮助!
我得到错误Expected 0 arguments, but got 1
或者,如果尝试在函数之外的某个地方定义useAppDispatch的简写,我会得到错误React Hook "useAppDispatch" cannot be called at the top
我目前正在学习关于useReducer的react。我正在尝试制作一个配方盒,里面有成分,尺寸和数量,你可以通过在文本输入框中输入来改变它们。但是每当我尝试打字时,整个列表就消失了,我就会得到这个错误。
react-dom.js:9
TypeError: Cannot read properties of undefined (reading 'ingredients')
at App (pen.js:63:26)
at Bi (react-dom.js:7:19481)
at ei (react-dom.js:9:31
我正在尝试使用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