diff options
Diffstat (limited to 'vnext/src/ui/Post.js')
-rw-r--r-- | vnext/src/ui/Post.js | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/vnext/src/ui/Post.js b/vnext/src/ui/Post.js index 35704f11..407f3b62 100644 --- a/vnext/src/ui/Post.js +++ b/vnext/src/ui/Post.js @@ -1,4 +1,5 @@ import React, { useState } from 'react'; +import { useLocation, useHistory } from 'react-router-dom'; import qs from 'qs'; @@ -8,9 +9,11 @@ import MessageInput from './MessageInput'; import { post, update } from '../api'; /** - * @param {{location: import('history').Location, visitor: import('../api').User, history: import('history').History}} props + * @param {{visitor: import('../api').User}} props */ -export default function Post({ location, visitor, history }) { +export default function Post({ visitor }) { + const location = useLocation(); + const history = useHistory(); let draftMessage = (location.state || {}).draft || {}; let [draft, setDraft] = useState(draftMessage.body); let params = qs.parse(window.location.search.substring(1)); |