diff options
Diffstat (limited to 'vnext/src/ui/Post.js')
-rw-r--r-- | vnext/src/ui/Post.js | 6 |
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); |