Difficulty: 6/10ReactDOM.createPortal, modal implementation, event handlingPortal is a way to render children into a DOM node that exists outside the DOM hierarchy of the parent component.The first argument (child) is any renderable React child, such as an element, string, or fragment. The second argument (container) is a DOM element.CopyScenario Questions0-2 years experience1How would you render a tooltip so it appears above other elements without being clipped by its parent’s overflow:hidden style?2If you need to mount a modal dialog into a div that lives outside your main app root, which React feature would you use and how would you implement it?3What happens if you try to create a portal targeting a DOM node that hasn’t been added to the page yet?2-5 years experienceFollow-up QuestionsWhat are the common pitfalls with event propagation when using portals?How do you ensure the portal container is properly cleaned up on unmount?Can you outline a testing approach for a component that renders via a portal?Suggest Improvement