OptionalWrapper

OptionalWrapper conditionally applies a wrapper without duplicating markup. It uses Show internally, so truthy when values render the wrapped children and falsy values render the fallback or the original children.

Basic usage#

Provide when and a wrapper function that receives the children and returns the wrapped result.

Custom fallback wrapper#

Use fallback to return an alternate wrapper when the condition is false.

Components - Control Flow Utilities | ilokesto - React Library Collection