The problem statement
Managing complex component state with basic hooks like useState can quickly become unwieldy.
Creating shared logic across components without causing unnecessary re-renders can be tricky.
Sometimes React's declarative approach isn't enough, and we need escape hatches to handle imperative tasks.
You need advanced techniques like portals to work with complex UIs that need to render outside the component tree.