From 1bbeff7b92bf5c36392b8892345affacd42e5665 Mon Sep 17 00:00:00 2001 From: bytesparallel Date: Thu, 16 Dec 2021 20:22:05 -0600 Subject: [PATCH] saving changes before trying link call method instead of history.push --- src/components/profile/Profile.js | 45 +++++++++++++++++++++++++++---- 1 file changed, 40 insertions(+), 5 deletions(-) diff --git a/src/components/profile/Profile.js b/src/components/profile/Profile.js index ae9ad43..e456295 100644 --- a/src/components/profile/Profile.js +++ b/src/components/profile/Profile.js @@ -1,27 +1,62 @@ -import react from "react"; +import { React } from "react" import { useState, useEffect } from "react"; export const Profile = () => { const [Users, fetchUsers] = useState([]) const [currentuser, setcurrentuser] = useState(localStorage.getItem("graphicsbaytracker_customer")) - const [currentUsertrackedcards, setcurrentUsertrackedcards] = useState([])) + const [currentUsertrackedcards, setcurrentUsertrackedcards] = useState([]) useEffect( () => { fetch("http://localhost:8088/trackedCards?_expand=cardDataId") .then(res => res.json()) .then(setcurrentUsertrackedcards) - },[]) + }, []) useEffect( () => { fetch("http://localhost:8088/users") .then(res => res.json()) .then(fetchUsers) - },[]) + }, []) return( <> - {/* why is this returning duplicate elements?*/} + {/* why is my code returning duplicate elements?*/}

returning something. This is a test

+ + + + + + + < tr > + + + { + currentUsertrackedcards.map( + gpudataobj => { + + return ( <> +

{ + gpudataobj.cardDataId.oem + } { + gpudataobj.cardDataId.brand + } { + gpudataobj.cardDataId.model + } { + gpudataobj.cardDataId.price + }

{ + + } + + ) + + } ) + } + + +
BrandModelPrice
) } \ No newline at end of file