aboutsummaryrefslogtreecommitdiff
path: root/vnext/src/ui/Header.js
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2022-10-28 12:48:23 +0300
committerGravatar Vitaly Takmazov2023-01-13 10:37:58 +0300
commit13c15825aa6b651439c043c75d9871e52c69cf9f (patch)
treed09a7540b29aa3fc70be1107170118088916fc45 /vnext/src/ui/Header.js
parent4039230974bb5275a70797c48f8c4635d253514c (diff)
Upgrade to `react-router` v6
Diffstat (limited to 'vnext/src/ui/Header.js')
-rw-r--r--vnext/src/ui/Header.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/vnext/src/ui/Header.js b/vnext/src/ui/Header.js
index 1574a489..3162c9ea 100644
--- a/vnext/src/ui/Header.js
+++ b/vnext/src/ui/Header.js
@@ -1,12 +1,12 @@
import { memo, useCallback } from 'react';
-import { Link, useHistory } from 'react-router-dom';
+import { Link, useNavigate } from 'react-router-dom';
import Icon from './Icon';
import { UserLink } from './UserInfo';
import SearchBox from './SearchBox';
function Header({ visitor, className }) {
- const history = useHistory();
+ const navigate = useNavigate();
/**
* @param {string} searchString
*/
@@ -14,8 +14,8 @@ function Header({ visitor, className }) {
let location = {};
location.pathname = '/discover';
location.search = `?search=${searchString}`;
- history.push(location);
- }, [history]);
+ navigate(location);
+ }, [navigate]);
return (
<div id="header" className={className}>
<div id="header_wrapper">