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
4444Like ` createElement ` , plus a ` key ` for rendering components in a dynamic list.
4545For more information see: https://reactjs.org/docs/reconciliation.html#keys
4646
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+
4757#### ` fragment `
4858
4959``` purescript
Original file line number Diff line number Diff line change @@ -15,16 +15,6 @@ text :: String -> JSX
1515
1616Create 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-
2818#### ` CSS `
2919
3020``` purescript
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ module React.Basic
33 , stateless
44 , createElement
55 , createElementKeyed
6+ , empty
67 , fragment
78 , fragmentKeyed
89 , JSX
@@ -15,6 +16,7 @@ import Prelude
1516import Control.Monad.Eff (Eff , kind Effect )
1617import Control.Monad.Eff.Uncurried (EffFn3 , mkEffFn3 )
1718import Data.Function.Uncurried (Fn2 , Fn3 , mkFn3 , runFn2 )
19+ import Unsafe.Coerce (unsafeCoerce )
1820
1921-- | A virtual DOM element.
2022foreign import data JSX :: Type
@@ -88,6 +90,12 @@ createElementKeyed
8890 -> JSX
8991createElementKeyed = runFn2 createElementKeyed_
9092
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+
9199-- | Render an Array of children without a wrapping component.
92100foreign import fragment :: Array JSX -> JSX
93101
Original file line number Diff line number Diff line change @@ -15,12 +15,6 @@ import Unsafe.Coerce (unsafeCoerce)
1515text :: String -> JSX
1616text = 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-
2418-- | An abstract type representing records of CSS attributes.
2519foreign import data CSS :: Type
2620
You can’t perform that action at this time.
0 commit comments