我在Reactjs中使用axios将用户的数据发送到php,然后用php创建一个新用户,但是当我想发送数据时,它会变为空,而我的php端会出现一些错误
我的反应密码
import React, { useReducer } from 'react';
import axios from 'axios';
import UserContext from './userContext';
import userReducer from './userReducer';
//Register user
const register
我正在尝试使用fetch调用上传一个图像,并且我一直收到以下错误:
Network request failed
at node_modules\whatwg-fetch\dist\fetch.umd.js:535:17 in setTimeout$argument_0
at node_modules\react-native\Libraries\Core\Timers\JSTimers.js:123:14 in _callTimer
at node_modules\react-native\Libraries\Core\Timers\JSTimers.js:379:16 in callTim
我才刚开始有反应。我成功地使用axios从http获取数据,并使用一个操作来推送数据。我可以在mapStateToProps输出数据,但它不会将数据设置为类中的prop。下面是我的代码,上面有关于数据可用性的注释。
import React from 'react';
import { connect } from 'react-redux';
import { fetchCountries } from '../../actions/actions';
import _ from 'lodash';
class TheClas