-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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
[Portal] Improve docs for container prop #39180
Conversation
Netlify deploy previewBundle size report |
@@ -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!} |
There was a problem hiding this comment.
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!}> |
There was a problem hiding this comment.
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() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dead code
9f1c97a
to
edb5343
Compare
edb5343
to
596ec1b
Compare
Co-authored-by: Sam Sycamore <[email protected]> Signed-off-by: Olivier Tassinari <[email protected]>
Signed-off-by: Olivier Tassinari <[email protected]> Co-authored-by: Sam Sycamore <[email protected]>
Signed-off-by: Olivier Tassinari <[email protected]> Co-authored-by: Sam Sycamore <[email protected]>
Signed-off-by: Olivier Tassinari <[email protected]> Co-authored-by: Sam Sycamore <[email protected]>
Signed-off-by: Olivier Tassinari <[email protected]> Co-authored-by: Sam Sycamore <[email protected]>
Signed-off-by: Olivier Tassinari <[email protected]> Co-authored-by: Sam Sycamore <[email protected]>
Signed-off-by: Olivier Tassinari <[email protected]> Co-authored-by: Sam Sycamore <[email protected]>
Based on mui/mui-x#10188 (comment)
Preview: https://deploy-preview-39180--material-ui.netlify.app/base-ui/react-portal/