chore: add portal context with comprehensive tests and storybook demo#6821
chore: add portal context with comprehensive tests and storybook demo#6821francinelucca merged 3 commits intochore/add-portal-contextfrom
Conversation
|
Co-authored-by: francinelucca <40550942+francinelucca@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
👋 Hi, this pull request contains changes to the source code that github/github depends on. If you are GitHub staff, we recommend testing these changes with github/github using the integration workflow. Thanks! |
| }) => { | ||
| const {portalContainerName} = useContext(PortalContext) | ||
| const elementRef = React.useRef<HTMLDivElement | null>(null) | ||
| const {portalContainerName} = useContext(PortalContext) |
There was a problem hiding this comment.
I attempted to re-add the line as requested, but it causes a syntax error since it creates a duplicate variable declaration: Identifier 'portalContainerName' has already been declared. The line const {portalContainerName} = useContext(PortalContext) already exists on line 73.
Could you clarify what specific line should be added at line 75? If you need the PortalContext usage in a different way, please let me know the intended implementation.
c19577c
into
chore/add-portal-context
size-limit report 📦
|
Adds PortalContext functionality to allow developers to control where Portal content is rendered, along with comprehensive tests and Storybook documentation.
Changes Made
Testing & Documentation
The PortalContext allows developers to wrap Portal components and control their rendering location without needing to pass containerName props individually, providing a cleaner API for managing multiple portals in an application.
Closes #
Changelog
New
Changed
Removed
Rollout strategy
Testing & Reviewing
The PortalContext functionality can be tested by viewing the "With Portal Context" story in Storybook under "Behaviors > Portal". The story demonstrates all use cases including default behavior, context-controlled rendering, and prop overrides.
Merge checklist
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.