Skip to main content

Migrate PortalsManager from Polaris React

Remove PortalsManager after all Polaris React overlays and portal consumers are gone. Test stacking, focus, and dismissal on each migrated overlay first.


Anchor to Choose the destinationChoose the destination

Polaris ReactPolaris web componentsMigration type
PortalsManagerRemove after migrating Polaris React overlays.Remove

Anchor to Remove provider responsibilitiesRemove provider responsibilities

Polaris React responsibilityPolaris web componentsMigration notes
Shared portal mountRemovePolaris web component overlays don't need a Polaris React portal host.
Modal and popover stackingManaged by s-modal and s-popoverDon't recreate a z-index manager around migrated overlays.
Test wrapperRemove from render helpersMock only the web components and App Bridge APIs that the test uses.

Anchor to Migrate the call siteMigrate the call site

  1. Find every PortalsManager consumer and identify which behavior, if any, still depends on it.

  2. Migrate those dependent components or behaviors first.

  3. Delete PortalsManager and its now-unused state or helper code once it has no remaining responsibility.

  4. Verify the containing workflow without the removed layer.


Anchor to Preserve these behaviorsPreserve these behaviors

  • Any user-visible behavior that was coupled to the removed component.
  • Behavior of remaining descendants, including focus, scrolling, overlays, or context where relevant.
  • Test setup and cleanup paths that referenced the removed layer.

Anchor to Test and remove Polaris ReactTest and remove Polaris React

Test the workflows that formerly depended on PortalsManager. Verify remaining descendants render correctly and that focus, scrolling, overlays, and test setup no longer rely on the removed layer.

Don't remove @shopify/polaris while another component still imports it. Once all call sites are migrated, remove the package and its provider-level setup, then run the app's full test suite.


Was this page helpful?