File tree Expand file tree Collapse file tree 3 files changed +15
-3
lines changed Expand file tree Collapse file tree 3 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -783,13 +783,21 @@ module ServerRenderingInternal =
783783 | ServerElementType.Component ->
784784 let tag = tag :?> System.Type
785785 let comp = System.Activator.CreateInstance( tag, props)
786+ #if NETSTANDARD1_ 6
787+ let tag = tag.GetTypeInfo()
788+ #endif
786789 let childrenProp = tag.GetProperty( ChildrenName)
787790 childrenProp.SetValue( comp, children |> Seq.toArray)
788791 let render = tag.GetMethod( " render" )
789792 render.Invoke( comp, null ) :?> ReactElement
790793
791794 let createServerElementByFn = fun ( f , props , children ) ->
795+ #if NETSTANDARD1_ 6
796+ let propsType ' = props.GetType()
797+ let propsType = propsType'.GetTypeInfo()
798+ #else
792799 let propsType = props.GetType()
800+ #endif
793801 let props =
794802 if propsType.GetProperty ( ChildrenName) |> isNull then
795803 props
@@ -801,6 +809,9 @@ module ServerRenderingInternal =
801809 values.Add ( children |> Seq.toArray)
802810 else
803811 values.Add ( FSharpValue.GetRecordField( props, p))
812+ #if NETSTANDARD1_ 6
813+ let propsType = propsType'
814+ #endif
804815 FSharpValue.MakeRecord( propsType, values.ToArray()) :?> 'P
805816 f props
806817
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ let private cssProp (html:StringBuilder) (key: string) (value: obj) =
3737 match value with
3838 | :? int as v -> addUnit html key ( string v)
3939 | :? float as v -> addUnit html key ( string v)
40- | _ -> html.Append value |> ignore
40+ | _ -> escapeHtml html ( value.ToString ()) |> ignore
4141
4242 html.Append ';' |> ignore
4343
@@ -615,7 +615,8 @@ let private renderHtmlAttr (html:StringBuilder) (attr: HTMLAttr) =
615615
616616 for cssProp in cssList do
617617 renderCssProp html cssProp
618-
618+ if not ( List.isEmpty cssList) then
619+ html.Remove ( html.Length - 1 , 1 ) |> ignore
619620 html.Append '"' |> ignore
620621
621622 | HTMLAttr.Custom ( key, value) -> strAttr html ( key.ToLower()) ( string value)
Original file line number Diff line number Diff line change 22<Project Sdk =" Microsoft.NET.Sdk" >
33 <PropertyGroup >
44 <Version >3.1.0</Version >
5- <TargetFramework >netstandard1.6</ TargetFramework >
5+ <TargetFrameworks >netstandard1.6;netstandard2.0</ TargetFrameworks >
66 </PropertyGroup >
77 <ItemGroup >
88 <Compile Include =" Fable.Import.React.fs" />
You can’t perform that action at this time.
0 commit comments