Hi everyone I'm using sessionStorage to save some tasks of my todo App, each of these has a dynamically generated key and I would like to bring all the values back to my page. I tried everything and asked many people, can anyone tell me how I can do it ?? Below is the example code...
let obj = Object.keys(sessionStorage)
let get_obj = obj.map((el)=> {return el;})
sessionStorage.getItem(get_obj)
After a few days of work, I found the solution ... The following must be done:
Object.keys(sessionStorage).map((el,i)=>{
let num = sessionStorage.getItem(el)
return(
<Task
key={i}
value={num}
/>
)
})