hari avula

hari avula

  • 1.5k
  • 101
  • 15k

I am getting promise error when i am returning pnpjs in spfx webpart.

Jul 23 2020 6:26 AM
I am getting data from sharepoint list using pnpjs and adding it to table. here when i am returning this pnp js getting below error.
 
 
 
Please find the below code for the same.
  1. private async getListData(){  
  2. return await pnp.sp.web.lists.getByTitle("EmployeeDetails").items.select().get().then(allitems=>{  
  3. return allitems.map(val=>{  
  4. <tr key={val.ID}>  
  5. <td>{val.Title}</td>  
  6. <td>{val.PhoneNumber}</td>  
  7. <td>{val.Address}</td>  
  8. <td>{val.Department}</td>  
  9. </tr>  
  10. });  
  11. });  
  12. }  

Answers (1)