u
This commit is contained in:
9
src/components/withNavigate.jsx
Normal file
9
src/components/withNavigate.jsx
Normal file
@@ -0,0 +1,9 @@
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
|
||||
export default function withNavigate(Wrapped) {
|
||||
function NavigateWrapper(props) {
|
||||
const navigate = useNavigate();
|
||||
return <Wrapped {...props} navigate={navigate} />;
|
||||
}
|
||||
return NavigateWrapper;
|
||||
}
|
||||
Reference in New Issue
Block a user