import * as React from 'react'; import styles from './ReactNew.module.scss'; import { IReactNewProps } from './IReactNewProps'; import { escape } from '@microsoft/sp-lodash-subset'; import pnp, { sp,Web } from 'sp-pnp-js'; export default class ReactNew extends React.Component { public render(): React.ReactElement { return (
Welcome to SharePoint!

Customize SharePoint experiences using Web Parts.

{escape(this.props.description)}

Learn more
); } componentDidMount(){ debugger; this._getListData(); } private _getListData() { let web = new Web(this.props.context.pageContext.web.absoluteUrl); web.lists.getByTitle('test').items.get().then(response=>console.log(response)) } }