You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
consthandleClone=async()=>{// creates a copy of the project
48
-
constupdatedProject: Project=JSON.parse(JSON.stringify(proj));// creates a deep copy
49
-
updatedProject.forked=`Forked from ${updatedProject.username}`;
50
-
awaitaxios.post('/cloneProject',{
51
-
updatedProject
52
-
});
51
+
constdocId=proj._id;
52
+
constresponse=awaitaxios.get(`/cloneProject/${docId}`,{params: {username: window.localStorage.getItem('username')}});//passing in username as a query param is query params
document.removeEventListener('click',handleClick,true);//cleanup for memory purposes. ensures handleclick isn't called after the component is no longer rendered
315
+
};
316
+
},[dropdownRef]);
317
+
318
+
returndropdownRef
319
+
320
+
}
321
+
322
+
constref=useOutsideClick(handleClose);
296
323
297
324
return(
298
-
<divclassName={showMenu}>
325
+
// <div ref={dropdownRef} className={showMenu}> dropdownRef making the menu fly off and anchorel messingup
0 commit comments