Skip to content

context.pageContext.legacyPageContext.userId #10508

@tivanchuk-hawe

Description

@tivanchuk-hawe

Target SharePoint environment

SharePoint Online

What SharePoint development model, framework, SDK or API is this about?

💥 SharePoint Framework

Developer environment

Windows

What browser(s) / client(s) have you tested

  • 💥 Internet Explorer
  • 💥 Microsoft Edge
  • 💥 Google Chrome
  • 💥 FireFox
  • 💥 Safari
  • mobile (iOS/iPadOS)
  • mobile (Android)
  • not applicable
  • other (enter in the "Additional environment details" area below)

Additional environment details

  • browser version latest edge
  • SPFx version 1.21.1
  • Node.js version 22*

Describe the bug / error

in WebPart context there is (IContext) context.pageContext.legacyPageContext.userId == ID for the current user from UseInfoList,

would be nice to add it to SPUser interface like context.pageContext.user.id

Im writing this because

  • NOTE: If certain functionality is exposed in the legacyPageContext but does not seem to have
  • a proper TypeScript API, please file an issue on GitHub. The intention is that no modern application
  • should need to rely on the legacyPageContext object.

Steps to reproduce

1.log context.pageContext.legacyPageContext.userId in the code
2.check TS declaration for context.pageContext.user

Expected behavior

see above

Metadata

Metadata

Assignees

Labels

sharepoint-developer-supportsharepoint-developer-supporttype:uservoice-requestEnhancements & feature requests should be posted: http://aka.ms/sp-dev-uservoice

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions