aboutsummaryrefslogtreecommitdiff
path: root/vnext/src/ui/Post.js
diff options
context:
space:
mode:
Diffstat (limited to 'vnext/src/ui/Post.js')
-rw-r--r--vnext/src/ui/Post.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/vnext/src/ui/Post.js b/vnext/src/ui/Post.js
index d8d841e1..a1d14ea0 100644
--- a/vnext/src/ui/Post.js
+++ b/vnext/src/ui/Post.js
@@ -1,5 +1,5 @@
import { useState } from 'react';
-import { useLocation, useHistory } from 'react-router-dom';
+import { useLocation, useNavigate } from 'react-router-dom';
import qs from 'qs';
@@ -13,7 +13,7 @@ import { post, update } from '../api';
*/
export default function Post({ visitor }) {
const location = useLocation();
- const history = useHistory();
+ const navigate = useNavigate();
let draftMessage = (location.state || {}).draft || {};
let [draft, setDraft] = useState(draftMessage.body);
let params = qs.parse(window.location.search.substring(1));
@@ -24,7 +24,7 @@ export default function Post({ visitor }) {
.then(response => {
if (response.status === 200) {
const msg = response.data.newMessage;
- history.push(`/${visitor.uname}/${msg.mid}`);
+ navigate(`/${visitor.uname}/${msg.mid}`);
}
}).catch(console.log);
};