import * as React from 'react'; import Portal from '@mui/material/Portal'; import { Box } from '@mui/system'; export default function SimplePortal() { const [show, setShow] = React.useState(false); const container = React.useRef(null); const handleClick = () => { setShow(!show); }; return (
It looks like I will render here. {show ? ( container.current!}> But I actually render here! ) : null}
); }