我正在使用ReactJS进行一个项目,并使用KnexJS访问数据库。我希望以组件的状态存储和使用我检索的JSON对象,如下所示。this.setState({tutors: tutors}) //Retrieval from database after promisethis.state.tutors[0].email this.state.tutors[0].firstnameTypeError: Cannot
我尝试在useEffect中更新数据,但在控制台中显示警告。React Hook useEffect has missing dependencies: 'dispatch', 'id', and 'state.selectedHotel'.Either include them or remove the dependency array react-hooks/exhaustive-depsimport { GlobalContext