我正在使用最新版本的react-router模块,名为react-router-dom,在使用React开发Web应用程序时已成为默认设置.我想知道如何在POST请求后进行重定向.我一直在制作这段代码,但在请求之后,没有任何反应.我在网上查看,但所有数据都是关于反应路由器的先前版本,而不是最后一次更新.
码:
import React, { PropTypes } from 'react';
import ReactDOM from 'react-dom';
import { BrowserRouter } from 'react-router-dom';
import { Redirect } from 'react-router'
import SignUpForm from '../../register/components/SignUpForm';
import styles from './PagesStyles.css';
import axios from 'axios';
import Footer from '../../shared/components/Footer';
class SignUpPage extends React.Component {
constructor(props) {
super(props);
this.state = {
errors: {},
client: {
userclient: '',
clientname: '',
clientbusinessname: '',
password: '',
confirmPassword: ''
}
};
this.processForm = this.processForm.bind(this);
this.changeClient = this.changeClient.bind(this);
}
changeClient(event) {
const field = …Run Code Online (Sandbox Code Playgroud)