Category : rendering

I want to simplify my component since I am returning my Modal, Window components and two divs twice, I would like to render them once and only alternate the title, barContainer and storageText divs when the mode prop is altered. the only things that change inside it if the modalMode changes is this part: (whats ..

Read more

When fetching data from http://www.dnd5eapi.co/ API, Using a function to render HTML via string template literal, but if a returned object value from the fetch is undefined it causes an error and no other HTML elements will generate. const renderRaceDescription = function (data) { const html = ` <h3 class="class_name">${data.name}</h3> <h4 class="class_size">${data.size}</h3> <p class="class_size-description">${data.size_description}</h3> <p ..

Read more

when i try to update my data i see this bug. const saveResult = async ()=>{ if(akiec=="" || bcc=="" ||bkl=="" ||df=="" ||melanoma=="" ||nv=="" ||vasc==""){ alert("Something is empty!!") } else{ await setLoading(true) await firebase .firestore() .collection(`Users/${email}/Results`) .doc(`${ID}`) .update({ akiec : akiec,//state bcc : bcc,//state bkl : bkl,//state df : df,//state melanoma : melanoma,//state nv : nv,//state ..

Read more

I am trying to render a section of code if the object UPCOMING has data, and a different section of code if the object doesn’t have data. The issue I am running into is when the object is empty, the key/value pairs used later in the code are throwing an error. import React, { useState ..

Read more