Skip to content

Commit b69140d

Browse files
committed
Add nothing to react helpers
1 parent dbead22 commit b69140d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/Fable.React/Fable.Helpers.React.fs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -878,6 +878,10 @@ let inline ofList (els: ReactElement list): ReactElement = unbox(List.toArray el
878878
/// Returns an array **from .render() method**
879879
let inline ofArray (els: ReactElement array): ReactElement = unbox els
880880

881+
/// A ReactElement when you don't want to render anything (null in javascript)
882+
[<Emit("null")>]
883+
let nothing: ReactElement = jsNative
884+
881885
#else
882886
/// Alias of `ofString`
883887
let inline str (s: string): ReactElement = HTMLNode.Text s :> ReactElement
@@ -905,6 +909,9 @@ let inline ofList (els: ReactElement list): ReactElement = HTMLNode.List els :>
905909
/// Returns an array **from .render() method**
906910
let inline ofArray (els: ReactElement array): ReactElement = HTMLNode.List els :> ReactElement
907911

912+
/// A ReactElement when you don't want to render anything (null in javascript)
913+
let nothing: ReactElement = HTMLNode.Empty :> ReactElement
914+
908915
#endif
909916

910917

0 commit comments

Comments
 (0)