File tree Expand file tree Collapse file tree 4 files changed +18
-16
lines changed Expand file tree Collapse file tree 4 files changed +18
-16
lines changed Original file line number Diff line number Diff line change @@ -44,6 +44,16 @@ createElementKeyed :: forall props. ReactComponent { | props } -> { key :: Stri
44
44
Like ` createElement ` , plus a ` key ` for rendering components in a dynamic list.
45
45
For more information see: https://reactjs.org/docs/reconciliation.html#keys
46
46
47
+ #### ` empty `
48
+
49
+ ``` purescript
50
+ empty :: JSX
51
+ ```
52
+
53
+ An empty node. This is often useful when you would like to conditionally
54
+ show something, but you don't want to (or can't) modify the ` children ` prop
55
+ on the parent node.
56
+
47
57
#### ` fragment `
48
58
49
59
``` purescript
Original file line number Diff line number Diff line change @@ -15,16 +15,6 @@ text :: String -> JSX
15
15
16
16
Create a text node.
17
17
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
-
28
18
#### ` CSS `
29
19
30
20
``` purescript
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ module React.Basic
3
3
, stateless
4
4
, createElement
5
5
, createElementKeyed
6
+ , empty
6
7
, fragment
7
8
, fragmentKeyed
8
9
, JSX
@@ -15,6 +16,7 @@ import Prelude
15
16
import Control.Monad.Eff (Eff , kind Effect )
16
17
import Control.Monad.Eff.Uncurried (EffFn3 , mkEffFn3 )
17
18
import Data.Function.Uncurried (Fn2 , Fn3 , mkFn3 , runFn2 )
19
+ import Unsafe.Coerce (unsafeCoerce )
18
20
19
21
-- | A virtual DOM element.
20
22
foreign import data JSX :: Type
@@ -88,6 +90,12 @@ createElementKeyed
88
90
-> JSX
89
91
createElementKeyed = runFn2 createElementKeyed_
90
92
93
+ -- | An empty node. This is often useful when you would like to conditionally
94
+ -- | show something, but you don't want to (or can't) modify the `children` prop
95
+ -- | on the parent node.
96
+ empty :: JSX
97
+ empty = unsafeCoerce false
98
+
91
99
-- | Render an Array of children without a wrapping component.
92
100
foreign import fragment :: Array JSX -> JSX
93
101
Original file line number Diff line number Diff line change @@ -15,12 +15,6 @@ import Unsafe.Coerce (unsafeCoerce)
15
15
text :: String -> JSX
16
16
text = unsafeCoerce
17
17
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
-
24
18
-- | An abstract type representing records of CSS attributes.
25
19
foreign import data CSS :: Type
26
20
You can’t perform that action at this time.
0 commit comments