Day: January 4, 2023

  • How to conditionally wrap an element in React

    The ConditionalWrap component checks the condition (in this example the element.url) and if it exists put the wrapper around the children, otherwise just render the children. The wrapper in this example is a link. You can put whatever content you want where the comment is to be put inside the link.