Skip to main content
Version: 1.0.5

getImage

@spartanfx/react v1.0.5


@spartanfx/react / getImage

Function: getImage()

getImage(imageFieldValue, type): any

Renders an image thumbnail or full image based on the type. Safely parses JSON if needed.

Parameters

imageFieldValue

any

The image field value from SharePoint.

type

Type of image to return: 'thumb' or 'normal'.

"normal" | "thumb"

Returns

any

The image URL string or null.

Example

getImage(imageFieldValue, type)