Skip to main content

useIMGElementState

export
function useIMGElementState(
  props: UseIMGElementStateProps
) : IMGElementState

This hook will compute concrete dimensions from image natural dimensions and constraints. It will fetch the image and get its dimensions.

Remarks

If you know the dimensions beforehand, use ​useIMGElementStateWithCache instead to save a network request and prevent a layout shift.

Parameters#

props#

required