Skip to content

Overlay2 migration

Adi Dahiya edited this page Jan 22, 2024 · 6 revisions

Overlay in Blueprint v6.0 features some breaking changes compared to previous versions. To help you migrate to the new component, we've provided a new component called Overlay2 in @blueprintjs/core v5.9.0+.

Notable changes compared to Overlay

  • The children of <Overlay2> must be native DOM elements or utilize React.forwardRef() to forward any injected ref to their underlying DOM element(s).
  • For single-child overlays:
    • if you attach your own ref to the child, you must pass the same React.RefObject<HTMLElement> value to <Overlay2> via the childRef prop (we need this to forward along to <CSSTransition>).
  • For overlays with multiple child elements:
    • regardless of whether you need your own ref on the child elements, you must enumerate a collection of refs for each of these elements and pass the collection along as a record (keyed by the elements' corresponding React key values) to <Overlay2 childRefs={...}>.
Clone this wiki locally