Skip to content
On this page

useResizeObserver

Dynamically get the size change of Dom elements.

Code demonstration

API

useResizeObserver(target, callback, {
  box: UseResizeObserverOptions,
})
useResizeObserver(target, callback, {
  box: UseResizeObserverOptions,
})

Params

参数说明类型默认值
targetDOM 节点或者 Ref 对象() => Element | Element | JSX.Element-
options额外的配置项UseResizeObserverOptions-

Options

参数说明类型默认值
box盒模型模式ResizeObserverBoxOptionscontent-box

Source

SourceDocsDemo