From b37c4ca04b7c520b0417d3dd897e8a92ebc3de2f Mon Sep 17 00:00:00 2001 From: jackyzha0 Date: Thu, 3 Sep 2020 22:41:21 -0700 Subject: replace dangerouslysetinnerhtml by using react-markdown --- frontend/src/components/ViewPaste.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'frontend/src/components/ViewPaste.js') diff --git a/frontend/src/components/ViewPaste.js b/frontend/src/components/ViewPaste.js index ebdc950..2d69544 100644 --- a/frontend/src/components/ViewPaste.js +++ b/frontend/src/components/ViewPaste.js @@ -15,7 +15,7 @@ function fmtDateStr(dateString) { } const ViewPaste = (props) => { - const [title, setTitle] = useState('untitled paste'); + const [title, setTitle] = useState('fetching paste...'); const [content, setContent] = useState(''); const [hasPass, setHasPass] = useState(false); const [enteredPass, setEnteredPass] = useState(''); @@ -64,8 +64,7 @@ const ViewPaste = (props) => { useEffect(() => { FetchPaste(props.hash) .then((response) => { - const data = response.data - setStateFromData(data) + setStateFromData(response.data) }).catch((error) => { const resp = error.response -- cgit v1.2.3