import React, { useState, useEffect } from "react"; const Profile = (props) => { const [state, setState] = useState({ user: { username: "HyperionLegion" }, topics: ["climate change", "covid19"], }); const [stocks, setStocks] = useState([]); const requestOptions = { method: "GET", headers: { Authorization: `Bearer ${localStorage.getItem("token")}`, }, }; const callAPI = () => { fetch(`${process.env.REACT_APP_API_ENDPOINT}/profile/`, requestOptions) .then((response) => response.json()) .then((data) => { if (data !== undefined) { setState(data); } }); }; useEffect(() => { callAPI(); }, []); return (
{topic}