import React, {useEffect} from 'react'; //renders a response from an api request const ResponseDisplay = ({ apiResponse, type, endpoint }) => { useEffect(() => { //render the table html if(type=='html'){ var tag_id = document.getElementById('apiResponse'); tag_id.innerHTML = apiResponse; } }, [apiResponse]) return ( <> {apiResponse &&

Response from {endpoint}:

{type == 'json' && JSON.stringify(apiResponse) } {type == 'csv' && apiResponse } {type == 'file' && apiResponse }
} ); } export default (ResponseDisplay);