1👍
This is because you are using react router dom old version in old version to page the
history.push("/abc")
in new version of react router dom we use this
import React from "react";
import { useNavigate } from "react-router-dom";
const Exp = () => {
const navigate = useNavigate();
const ChangePage = () => {
navigate("/placeorder");
};
return <button onClick={ChangePage}>Change</button>;
};
export default Exp;
for more info vist the site
0👍
You need to import the useHistory hook from react-router-dom: https://v5.reactrouter.com/web/api/Hooks
Example:
import { useHistory } from "react-router-dom";
function HomeButton() {
let history = useHistory();
function handleClick() {
history.push("/home");
}
return (
<button type="button" onClick={handleClick}>
Go home
</button>
);
}
- [Answered ]-Products catalogue: filter by parameters
- [Answered ]-Master/detail using the admin in django
- [Answered ]-How to pass multiple app's models in one views? [django]
- [Answered ]-Base.html for Django Registration Redux
Source:stackexchange.com