我在用着react-router-dom。用户注册成功后,我需要重定向到仪表板。但我的Redirect组件不工作。我该如何修复这个错误?
这是我的Register.jsx文件。
import React, { useState, useEffect } from "react";
import { Redirect } from "react-router-dom";
import Axios from "axios";
function Register() {
// Use state
const [name, setName] = useState();
const [email, setEmail] = useState();
const [password, setPassword] = useState();
const [errors, setErrors] = useState({});
// Form submitted
const formSubmit = (e) => {
e.preventDefault();
// Send data
Axios.defaults.withCredentials = true;
Axios.get("http://localhost:8000/sanctum/csrf-cookie").then(
(response) => {
console.log(response);
Axios.post("http://localhost:8000/api/auth/register", {
name: name,
email: email,
password: …Run Code Online (Sandbox Code Playgroud) 大家好,我正在Firefox 浏览器中使用Vue 开发工具。Vue devtools 在Vue 2.6.12应用程序上完美检测。但它没有在Vue 3.0.0应用程序上检测到。如何解决这个问题。 谢谢