aboutsummaryrefslogtreecommitdiff
path: root/vnext/src/ui/Post.js
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2022-11-19 23:57:21 +0300
committerGravatar Vitaly Takmazov2023-01-13 10:37:59 +0300
commitec0551528d09ab35345aba254d5ce9cd8f04f1ab (patch)
tree97f9ba3bad92754b8fb47b7bf921668c7bb4dddd /vnext/src/ui/Post.js
parentda8f9c3c731d7511b59b994e47762d6f0770b554 (diff)
qs -> URLSearchParams
Diffstat (limited to 'vnext/src/ui/Post.js')
-rw-r--r--vnext/src/ui/Post.js6
1 files changed, 2 insertions, 4 deletions
diff --git a/vnext/src/ui/Post.js b/vnext/src/ui/Post.js
index fbd55675..74b74ffc 100644
--- a/vnext/src/ui/Post.js
+++ b/vnext/src/ui/Post.js
@@ -1,7 +1,5 @@
import { useState } from 'react';
-import { useLocation, useNavigate } from 'react-router-dom';
-
-import qs from 'qs';
+import { useLocation, useNavigate, useSearchParams } from 'react-router-dom';
import Button from './Button';
import MessageInput from './MessageInput';
@@ -19,7 +17,7 @@ export default function Post() {
const [visitor] = useVisitor();
let draftMessage = (location.state || {}).data || {};
let [draft, setDraft] = useState(draftMessage.body);
- let params = qs.parse(window.location.search.substring(1));
+ let params = useSearchParams();
let postMessage = (template) => {
const { attach, body } = template;
const postAction = draftMessage.mid ? update(draftMessage.mid, 0, body) : post(body, attach);