import { useState, useEffect } from 'react' import './App.css' function App() { useEffect(() => {getSurvey()},[]); const [responses,setResponses] = useState([]); function getSurvey() { const url = window.location.href; if(url.indexOf('#') > 0) { let parts = url.split('#'); let id = parts[1]; fetch("http://localhost:8085/responses?survey="+id).then(response=>response.json()).then(response=>{setResponses(response);}); } } if(responses.length > 0) return (
No data to display
{response.prompt}
{response.prompt}