Skip to content

Feature/specify container#19

Merged
mpontus merged 7 commits intomasterfrom
feature/specify-container
Feb 5, 2020
Merged

Feature/specify container#19
mpontus merged 7 commits intomasterfrom
feature/specify-container

Conversation

@mpontus
Copy link
Copy Markdown
Owner

@mpontus mpontus commented Feb 5, 2020

This PR makes it possible to specify a custom mount node for the portal component.

To conform with conventions established in React.createPortal and MUI container prop has been renamed to rootComponent and reused for this purpose.

  • Rename ModalProvider#container prop to rootComponent
  • Introduce ModalProvider#container prop to specify DOM element to mount modals into
  • Add prop validation logic to ModalProvider to help users transition after the breaking change
  • Unexpose ModalRoot to prevent unexpected use-cases
  • Update documentation

Fixes #18

@codecov-io
Copy link
Copy Markdown

codecov-io commented Feb 5, 2020

Codecov Report

Merging #19 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master    #19   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files           4      4           
  Lines          48     57    +9     
  Branches        7      9    +2     
=====================================
+ Hits           48     57    +9
Impacted Files Coverage Δ
src/ModalRoot.tsx 100% <100%> (ø) ⬆️
src/ModalProvider.tsx 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4e410e0...38bf196. Read the comment docs.

@mpontus mpontus merged commit 659e78a into master Feb 5, 2020
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.

Adjust the createPortal approach

2 participants