@@ -616,21 +616,24 @@ let inline ofFunction<[<Pojo>]'P> (f: 'P -> ReactElement) (props: 'P) (children:
616616 createElement( f, props, children)
617617
618618/// Instantiate an imported React component. The first two arguments must be string literals, "default" can be used for the first one.
619- /// Example: `ofImported "Map" "leaflet" { x = 10; y = 50 } []`
620- let inline ofImported <[< Pojo >] 'P > ( importMember : string ) ( importPath : string ) ( props : 'P ) ( children : ReactElement list ): ReactElement =
619+ /// Example: `ofImport "Map" "leaflet" { x = 10; y = 50 } []`
620+ let inline ofImport <[< Pojo >] 'P > ( importMember : string ) ( importPath : string ) ( props : 'P ) ( children : ReactElement list ): ReactElement =
621621 createElement( import importMember importPath, props, children)
622622
623- /// OBSOLETE: Use `ofString`
624- [<System.Obsolete( " Use ofString" ) >]
623+ /// Alias of `ofString`
625624let inline str ( s : string ): ReactElement = unbox s
626- /// OBSOLETE: Use `ofOption`
627- [<System.Obsolete( " Use ofOption" ) >]
628- let inline opt ( o : ReactElement option ): ReactElement = unbox o
629625
630626/// Cast a string to a React element (erased in runtime)
631627let inline ofString ( s : string ): ReactElement = unbox s
628+
629+ /// OBSOLETE: Use `ofOption`
630+ [<System.Obsolete( " Use ofOption" ) >]
631+ let inline opt ( o : ReactElement option ): ReactElement =
632+ match o with Some o -> o | None -> null
633+
632634/// Cast an option value to a React element (erased in runtime)
633- let inline ofOption ( o : ReactElement option ): ReactElement = unbox o
635+ let inline ofOption ( o : ReactElement option ): ReactElement =
636+ match o with Some o -> o | None -> null // Option.toObj(o)
634637
635638/// Cast an int to a React element (erased in runtime)
636639let inline ofInt ( i : int ): ReactElement = unbox i
0 commit comments