🚀 Advanced Web Server Manager
Complete File Manager & Terminal - Standalone Version
By Sid Gifari | Gifari Industries
Current path:
/
/
mnt
/
web613
/
c2
/
38
/
570372438
/
htdocs
/
STRATO-apps
/
wordpress_02
/
app
/
wp-content
/
plugins
/
elementor-pro
/
core
/
app
/
modules
/
site-editor
/
assets
/
js
/
pages
/
conditions
✏️
Editing: condition-button-portal.js
import { createPortal } from 'react-dom'; import { useState, useEffect } from 'react'; import * as PropTypes from 'prop-types'; const ConditionButtonPortal = ( props ) => { const [ shouldCreatePortal, setShouldCreatePortal ] = useState( false ), portalRoot = document.getElementById( 'portal-root' ); useEffect( () => { setShouldCreatePortal( ! ! portalRoot ); }, [ portalRoot ] ); return shouldCreatePortal ? createPortal( props.children, portalRoot ) : null; }; ConditionButtonPortal.propTypes = { children: PropTypes.oneOfType( [ PropTypes.node, PropTypes.string ] ), }; export default ConditionButtonPortal;
💾 Save Changes
❌ Cancel