react-native-grid-image-viewer icon indicating copy to clipboard operation
react-native-grid-image-viewer copied to clipboard

Render No Content Text/Placeholder if Array is Empty

Open tonydatw opened this issue 3 years ago • 1 comments

Is there a way to render an empty text or image showed when Array is empty? Something like, "No images to show" or ListEmptyComponer FlatList props.

tonydatw avatar Dec 08 '21 15:12 tonydatw

const data=['url1', 'url2', 'url3', 'url4']

return (
  <>
    {data.length > 0 ? (
      <GridImageView
        data={data}
      />
    ) : (
      <ReactNativeText>No images to show</ReactNativeText>
    )}
  </>
)

cavasinf avatar Aug 05 '22 12:08 cavasinf