title: Taro.onWindowResize(callback)

sidebar_label: onWindowResize

Listens on the window size change event.

Reference

Type

  1. (callback: Callback) => void

Parameters

Callback

The callback function for the window size change event.

  1. (result: CallbackResult) => void
Property Type
result CallbackResult

CallbackResult

Property Type
size Size

Size

Property Type Description
windowHeight number New window width (in px)
windowWidth number New window height (in px)

API Support

API WeChat Mini-Program H5 React Native
Taro.onWindowResize ✔️ ✔️ ✔️