From cad0c541dc289e16ecc76a9c136b9a384992ed5d Mon Sep 17 00:00:00 2001 From: Phil Freeman Date: Fri, 4 May 2018 14:29:04 -0700 Subject: [PATCH] Add 'empty' --- generated-docs/React/Basic/DOM.md | 10 ++++++++++ src/React/Basic/DOM.purs | 6 ++++++ 2 files changed, 16 insertions(+) diff --git a/generated-docs/React/Basic/DOM.md b/generated-docs/React/Basic/DOM.md index 3bcf6d6..9f25b73 100644 --- a/generated-docs/React/Basic/DOM.md +++ b/generated-docs/React/Basic/DOM.md @@ -15,6 +15,16 @@ text :: String -> JSX Create a text node. +#### `empty` + +``` purescript +empty :: JSX +``` + +An empty node. This is often useful when you would like to conditionally +show something, but you don't want to (or can't) modify the `children` prop +on the parent node. + #### `CSS` ``` purescript diff --git a/src/React/Basic/DOM.purs b/src/React/Basic/DOM.purs index 288c468..fe98853 100644 --- a/src/React/Basic/DOM.purs +++ b/src/React/Basic/DOM.purs @@ -15,6 +15,12 @@ import Unsafe.Coerce (unsafeCoerce) text :: String -> JSX text = unsafeCoerce +-- | An empty node. This is often useful when you would like to conditionally +-- | show something, but you don't want to (or can't) modify the `children` prop +-- | on the parent node. +empty :: JSX +empty = unsafeCoerce false + -- | An abstract type representing records of CSS attributes. foreign import data CSS :: Type