Open TheNexusDeveloper opened 2 years ago
Its about react-router-dom v6, you can't use location.search, import useSearchParamas in react-router-dom, but i didnt find yet how to use it, if you have error in LoginScreen, you need to have error with CartScreen, because it use same method
in react v6, u need use: useLocation from reactre-router-dom and remove the location parameter then it will work
the code is shown below, I believe the error is occuring because I'm using react router v6 how do I write this code in react router v6
import React, {useState, useEffect} from 'react' import { Link } from 'react-router-dom' import { Form, Button, Row, Col } from 'react-bootstrap' import { useDispatch, useSelector } from 'react-redux' import Loader from '../components/Loader' import Message from '../components/Message' import FormContainer from '../components/FormContainer'
import { login } from '../actions/userActions'
function Loginpage({ Location, history }) { const [email, setEmail] = useState('') const [password, setPassword] = useState('')
return (
Sign In
{error &&) }
export default Loginpage