Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use a modern React context for identity in the app #30098

Merged
merged 1 commit into from
May 19, 2024

Commits on Apr 28, 2024

  1. Use a modern React context for identity in the app

    This removes the last usage of the old and deprecated React context API (which will be removed from React 19, and outputs deprecation warnings in React 18.3).
    
    Modern context can be used through `contextType` in class components, but it makes them not explicit when consumed (it would have been `this.context.me`, not `this.context.identity.me`).
    
    I preferred to switch to injecting an `identity` prop using a wrapper component inspired by `withOptionalRouter`, so consuming identity is explicit (`this.props.identity`).
    renchap committed Apr 28, 2024
    Configuration menu
    Copy the full SHA
    aa2035e View commit details
    Browse the repository at this point in the history