I'm experiencing a situation where the shimmer is container View is rendered even when the children is null / false.
I expected the shimmer container view not to be rendered when children is null / false.
This causes the shimmer to reserve space according to its height and width even when there is nothing to render.
Example JSX:
<ShimmerPlaceholder visible={!loading}>
{Boolean(data) && <Text>{data}</Text>}
</ShimmerPlaceholder>
In case where loading is false but data is falsy, this JSX render an empty View. I think it would be better to not render anything in this case. I think this could be changed by adding the following code to the BaseShimmerPlaceholder
if (visible && (children === null || children === false)) {
return null
}
Is this an issue or a design decision that has been made? Is my proposed fix feasible or are there some issues with it?
I'm experiencing a situation where the shimmer is container View is rendered even when the children is null / false.
I expected the shimmer container view not to be rendered when children is null / false.
This causes the shimmer to reserve space according to its height and width even when there is nothing to render.
Example JSX:
In case where
loadingisfalsebut data is falsy, this JSX render an empty View. I think it would be better to not render anything in this case. I think this could be changed by adding the following code to theBaseShimmerPlaceholderIs this an issue or a design decision that has been made? Is my proposed fix feasible or are there some issues with it?