useSetItemSize
Hook that sets the size of the widget in pixels.
Returns
An object with two setter methods for the width and height. The setters are like useState
state setters which can
directly take the new value or a callback with the previous value as argument.
Example
src/widgets/example/Example.tsx
import React, {useEffect} from 'react'
import {useSetItemSize} from '@modbros/dashboard-sdk'
export default function Example() {
const {setWidth, setHeight} = useSetItemSize()
useEffect(() => {
setWidth((w) => w + 1)
// or setWidth(10)
setHeight((h) => h + 1)
// or setHeight(10)
}, [])
return null
}