Forum Discussion
Mike Jansen
Oct 25, 2017Iron Contributor
SPFX - Pnp.sp.search. Simple HelloWorld will not build
I created te default HelloWorld app with React. Added pnp (npm install sp-pnp-js -- save) So far so good. Gulp serve and the app runs fine. Now I want to add a search so I changed the HelloW...
- Oct 26, 2017
Used a different syntax which is working:
private GetSearchresults(): void { pnp.sp.search({ Querytext: "ContentType:TEST_matters", RowLimit: 5 }).then((result: SearchResults) => { var props = result.PrimarySearchResults; });Still do not understand why the first one does not build because is does in a non-react example.
Mike Jansen
Oct 26, 2017Iron Contributor
Used a different syntax which is working:
private GetSearchresults(): void {
pnp.sp.search({
Querytext: "ContentType:TEST_matters",
RowLimit: 5
}).then((result: SearchResults) => {
var props = result.PrimarySearchResults;
});Still do not understand why the first one does not build because is does in a non-react example.