fix pnp sp init
This commit is contained in:
parent
b02e49046e
commit
6c85b8403c
|
@ -19,7 +19,7 @@
|
|||
"@microsoft/sp-property-pane": "1.15.2",
|
||||
"@microsoft/sp-webpart-base": "1.15.2",
|
||||
"@pnp/logging": "^3.6.0",
|
||||
"@pnp/sp": "^3.6.0",
|
||||
"@pnp/sp": "^3.11.0",
|
||||
"clsx": "^1.2.1",
|
||||
"office-ui-fabric-react": "7.185.7",
|
||||
"react": "16.13.1",
|
||||
|
@ -43,4 +43,4 @@
|
|||
"gulp": "4.0.2",
|
||||
"typescript": "4.5.5"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -9,7 +9,7 @@ import "@pnp/sp/batching";
|
|||
let _sp: SPFI = null;
|
||||
|
||||
export const getSP = (context?: WebPartContext): SPFI => {
|
||||
if (_sp === null && context !== null) {
|
||||
if (context != null) {
|
||||
_sp = spfi().using(SPFx(context)).using(PnPLogging(LogLevel.Warning));
|
||||
}
|
||||
return _sp;
|
||||
|
|
Loading…
Reference in New Issue