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

[Portal] Improve docs for container prop #39180

Merged

Conversation

oliviertassinari
Copy link
Member

@oliviertassinari oliviertassinari commented Sep 26, 2023

@oliviertassinari oliviertassinari added docs Improvements or additions to the documentation component: Portal The React component. labels Sep 26, 2023
@mui-bot
Copy link

mui-bot commented Sep 26, 2023

@@ -27,7 +27,7 @@ export default function ServerModal() {
open
aria-labelledby="server-modal-title"
aria-describedby="server-modal-description"
container={() => rootRef.current}
container={() => rootRef.current!}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ref is guaranteed to be defined when it runs in an effect.

@@ -4,7 +4,7 @@
<Box sx={{ p: 1, my: 1, border: '1px solid' }}>
It looks like I will render here.
{show ? (
<Portal container={container.current}>
<Portal container={() => container.current!}>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In case developers use this withshow={true} by default.

import Box from '@mui/material/Box';
import Portal from '@mui/material/Portal';

export default function SimplePortal() {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dead code

@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Oct 18, 2023
@oliviertassinari oliviertassinari force-pushed the improve-portal-container-prop branch from edb5343 to 596ec1b Compare November 26, 2023 23:55
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Nov 26, 2023
@oliviertassinari oliviertassinari enabled auto-merge (squash) November 27, 2023 14:53
@oliviertassinari oliviertassinari merged commit 44ffe25 into mui:master Nov 27, 2023
9 checks passed
@oliviertassinari oliviertassinari deleted the improve-portal-container-prop branch November 27, 2023 14:55
mnajdova pushed a commit to mnajdova/material-ui that referenced this pull request Nov 30, 2023
Signed-off-by: Olivier Tassinari <[email protected]>
Co-authored-by: Sam Sycamore <[email protected]>
mnajdova pushed a commit to mnajdova/material-ui that referenced this pull request Dec 1, 2023
Signed-off-by: Olivier Tassinari <[email protected]>
Co-authored-by: Sam Sycamore <[email protected]>
mnajdova pushed a commit to mnajdova/material-ui that referenced this pull request Dec 1, 2023
Signed-off-by: Olivier Tassinari <[email protected]>
Co-authored-by: Sam Sycamore <[email protected]>
mnajdova pushed a commit to mnajdova/material-ui that referenced this pull request Dec 6, 2023
Signed-off-by: Olivier Tassinari <[email protected]>
Co-authored-by: Sam Sycamore <[email protected]>
mnajdova pushed a commit to mnajdova/material-ui that referenced this pull request Dec 6, 2023
Signed-off-by: Olivier Tassinari <[email protected]>
Co-authored-by: Sam Sycamore <[email protected]>
mnajdova pushed a commit to mnajdova/material-ui that referenced this pull request Dec 6, 2023
Signed-off-by: Olivier Tassinari <[email protected]>
Co-authored-by: Sam Sycamore <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: Portal The React component. docs Improvements or additions to the documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants