Skip to content

Commit 3be53ea

Browse files
authored
Add 'empty' (#29)
1 parent c1b94f2 commit 3be53ea

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

generated-docs/React/Basic/DOM.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,16 @@ text :: String -> JSX
1515

1616
Create a text node.
1717

18+
#### `empty`
19+
20+
``` purescript
21+
empty :: JSX
22+
```
23+
24+
An empty node. This is often useful when you would like to conditionally
25+
show something, but you don't want to (or can't) modify the `children` prop
26+
on the parent node.
27+
1828
#### `CSS`
1929

2030
``` purescript

src/React/Basic/DOM.purs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ import Unsafe.Coerce (unsafeCoerce)
1515
text :: String -> JSX
1616
text = unsafeCoerce
1717

18+
-- | An empty node. This is often useful when you would like to conditionally
19+
-- | show something, but you don't want to (or can't) modify the `children` prop
20+
-- | on the parent node.
21+
empty :: JSX
22+
empty = unsafeCoerce false
23+
1824
-- | An abstract type representing records of CSS attributes.
1925
foreign import data CSS :: Type
2026

0 commit comments

Comments
 (0)