I'm building a SPFX React webpart. I currently have the webpart on my SharePoint site's workbench page.
Here is the code that I'm currently using:
private _renderListAsync(): void {
// Local Enviroment
if (Environment.type === EnvironmentType.Local) {
console.log('This is local!');
}
else if (Environment.type === EnvironmentType.SharePoint || Environment.type === EnvironmentType.ClassicSharePoint) {
console.log('This is Sharepoint!!');
pnp.sp.web.lists.getByTitle("Data").items.get().then((items: any[]) => {
items.map((item) => {
console.log(item);
console.log(item.Full_Name);
return item.Full_Name;
})
});
}
}
In my console I'm able to see all the data from that item. And if I do a console.log(item.Full_Name)
I see all the data there. However when I try to return the item on the page it displays null
. Any ideas on how to fix this?