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

[core] feat(Portal): add support for new context API #5493

Merged
merged 3 commits into from
Aug 9, 2022

Conversation

adidahiya
Copy link
Contributor

@adidahiya adidahiya commented Aug 8, 2022

This will eventually fix #5139, but for now we need to keep legacy context for backwards-compatibility, so the console warning will remain.

Checklist

  • Includes tests
  • Update documentation

Changes proposed in this pull request:

  • Remove mentions of React 15 from Portal documentation
  • Remove code which supported React 15 in Portal implementation (guarding against React.createPortal not being available)
  • Create PortalContext and PortalProvider APIs which allow setting global options on Portals in a given React subtree using the newer React context API
  • Refactor Portal into a React function component which uses PortalContext for forwards-compatibility with the new PortalProvider API, while retaining backwards-compatibility with the legacy context API (legacyContext: PortalLegacyContext passed in the constructor)

Reviewers should focus on:

No regressions

@blueprint-bot
Copy link

[core] feat(Portal): add support for new context API

Previews: documentation | landing | table | demo

@blueprint-bot
Copy link

combine into one component, fix tests

Previews: documentation | landing | table | demo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Popover2 Warning - Portal uses legacy React context
2 participants