diff --git a/src/javascript/app/pages/portal.jsx b/src/javascript/app/pages/portal.jsx index a7226882f30..f499b93ac7a 100644 --- a/src/javascript/app/pages/portal.jsx +++ b/src/javascript/app/pages/portal.jsx @@ -2,11 +2,7 @@ import { useEffect, useRef } from 'react'; import ReactDOM from 'react-dom'; const Portal = ({ children }) => { - const elRef = useRef(null); - - if (!elRef.current) { - elRef.current = document.createElement('div'); - } + const elRef = useRef(document.createElement('div')); useEffect(() => { const el = elRef.current;