serviceScope={serviceScope from AppContext} Does not pass typescript in SPFx 1.15
See original GitHub issueCategory
[ ] Enhancement
[? ] Bug
[ ?] Question
Version 3.8.1
Using
const { wpContext } = React.useContext(AppContext);
const sp:ServiceScope = wpContext.serviceScope;
I get TS error:
TS2322: Type 'import("C:/DATA/Sources/Repos/SPFx15/DpcAllJobsScreen/node_modules/@microsoft/sp-core-library/dist/index-internal").ServiceScope' is not assignable to type 'import("C:/DATA/Sources/Repos/SPFx15/DpcAllJobsScreen/node_modules/@pnp/spfx-property-controls/node_modules/@microsoft/sp-core-library/dist/index-internal").ServiceScope'.
Types have separate declarations of a private property '_registrations'.
163 | const sp:ServiceScope = wpContext.serviceScope;
164 | return (
> 165 | <LivePersona upn={params.data.RequestFor.Email} serviceScope={sp}
| ^^^^^^^^^^^^
How can I use “LivePersona” with hooks deep in child component? what is “private property '_registrations”
Thanks
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Getting Started - PnP/PnPjs
This library is geared towards folks working with TypeScript but will work ... and can be found in the react-pnp-js-sample project, utilizing SPFx...
Read more >SPFx: Using React hooks to globally share service scope ...
React hooks can only be used from functional components and not classes. With the SPFx generator creating classes by default and hooks being ......
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
@AJIXuMuK any plans, or estimations about when 1.15 will be integrated?
@Ofer-Gal 2 workarounds: