mirror of
https://github.com/pnp/sp-dev-fx-webparts.git
synced 2025-02-08 22:14:53 +00:00
Fixing Context Conditional in GetSP
Better handling of truthy/falsy
This commit is contained in:
parent
212fb8f13a
commit
d3cd98f612
@ -12,7 +12,7 @@ import "@pnp/sp/batching";
|
|||||||
var _sp: SPFI = null;
|
var _sp: SPFI = null;
|
||||||
|
|
||||||
export const getSP = (context?: WebPartContext): SPFI => {
|
export const getSP = (context?: WebPartContext): SPFI => {
|
||||||
if (context != null) { // eslint-disable-line eqeqeq
|
if (!!context) { // eslint-disable-line eqeqeq
|
||||||
//You must add the @pnp/logging package to include the PnPLogging behavior it is no longer a peer dependency
|
//You must add the @pnp/logging package to include the PnPLogging behavior it is no longer a peer dependency
|
||||||
// The LogLevel set's at what level a message will be written to the console
|
// The LogLevel set's at what level a message will be written to the console
|
||||||
_sp = spfi().using(SPFx(context)).using(PnPLogging(LogLevel.Warning));
|
_sp = spfi().using(SPFx(context)).using(PnPLogging(LogLevel.Warning));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user