79291537

Date: 2024-12-18 15:03:16
Score: 1
Natty:
Report link

Correct Way is first you check

state is not equal to initialstate

const [data,setData] = useState('initial state')

//component code 
 <>
   {data != 'initial state' && (data.length>0 ? data.map((dat)=>{} : <>no data</> ))                         }
 </>
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: web devlopment king