Type 'WebPartContext' is not assignable to type 'BaseComponentContext'.
See original GitHub issueCategory
[ ] Enhancement
[ ] Bug
[X] Question
Version
Please specify what version of the library you are using: [ 3.0.0 ]
Expected / Desired Behavior / Question
Before 3.0.0 the context={props.context}
for FilePicker and ListItemPicker was OK with WebPartContext inherited from the context: this.context
from the web part class.
Observed Behavior
After upgrade to 3.0.0 , TS complains that “Type ‘WebPartContext’ is not assignable to type ‘BaseComponentContext’.”
I am OK for now by using context={props.context as any}
But I would like to know the right way to do it.
Thanks for a great collection!
Issue Analytics
- State:
- Created 2 years ago
- Comments:29 (8 by maintainers)
Top Results From Across the Web
BaseComponentContext class - Microsoft Learn
Each component type has its own specialized subclass of BaseComponentContext, e.g. WebPartContext for web parts, ExtensionContext for client-side extensions ...
Read more >PNP PeoplePicker Type 'WebPartContext' is missing the ...
I am using spfx Peoplepicker control in my spfx react webpart solution but Peoplepicker control encountering the below error. Error : Type ' ......
Read more >PeoplePicker - @pnp/spfx-controls-react
Property Type Required Default
context BaseComponentContext yes
titleText string no
groupName string no none
Read more >SPFx Extension - Page Context is missing
No its not removed or deprecated. Its working correctly . Just upgraded a sample and was able to work with the this.context object...
Read more >https://unpkg.com/@microsoft/sp-application-base@1...
@remarks * Third parties should not call this constructor. ... Excluded from this release type: _initializeExtensionType */ /** * {@inheritDoc ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I was getting this on the PropertyFieldColumnPicker and this worked for me to get past this error.
context: this.context as any,
“@pnp/spfx-controls-react”: “3.4.0”, with SPFx 1.13.0 shows the same typescript error 😃