finished project
This commit is contained in:
21
src/components/BackButton.jsx
Normal file
21
src/components/BackButton.jsx
Normal file
@@ -0,0 +1,21 @@
|
||||
import React from "react";
|
||||
import Button from "./Button";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
|
||||
|
||||
const BackButton = () => {
|
||||
const navigate=useNavigate();
|
||||
return (
|
||||
<Button
|
||||
type="back"
|
||||
onClick={(e) => {
|
||||
e.preventDefault();
|
||||
navigate(-1);
|
||||
}}
|
||||
>
|
||||
← Back
|
||||
</Button>
|
||||
);
|
||||
};
|
||||
|
||||
export default BackButton;
|
||||
Reference in New Issue
Block a user