-
Notifications
You must be signed in to change notification settings - Fork 2.2k
ResizeSensor 5.0 changes
Adi Dahiya edited this page Sep 29, 2021
·
1 revision
ResizeSensor in Blueprint v5.0 features some breaking changes compared to v4.0. Although you may not use this component directly, it is used in other components like Popover and Tooltip. To help you migrate to the new implementation, @blueprintjs/popover2 v4.x contains a new component called ResizeSensor2 (which, in turn, is used in Popover2).
<ResizeSensor2>
and advanced Popover2/Tooltip2 usage via renderTarget
(e.g. <Popover2 renderTarget={...}>
and <Tooltip2 renderTarget={...}>
). Standard usage of Popover2/Tooltip2 does not require any intervention since those components inject a ResizeSensor2-compatible wrapper DOM element for you.
- The child of
<ResizeSensor2>
can only be a single DOM element or React component. - The child (target) of
<ResizeSensor2>
must be a native DOM element or utilizeReact.forwardRef()
to forward any injected ref to the underlying DOM element.- In addition, if you attach a
ref
to the child yourself, you must pass the same value to<ResizeSensor2>
with thetargetRef
prop (otherwise, the component won't be able to attach one itself).
- In addition, if you attach a
- react-day-picker v8 migration
- HotkeysTarget & useHotkeys migration
- PanelStack2 migration
- Table 6.0 changes