anchor.diff:    else
       htmlNode :?> HTMLNode
   
  +let rec writeTo (html: TextWriter) (htmlNode: HTMLNode) : unit =
  +    match htmlNode with
  +    | HTMLNode.Text str -> escapeHtml html str
  +    | HTMLNode.RawText str -> html.Write str
  +    | HTMLNode.Node (tag, attrs, children) ->
  +      html.Write '<'
  +      html.Write tag
  +
  +      let child = renderAttrs html attrs tag
  +
  +      if voidTags.Contains tag then
  +        html.Write "/>"
  +      else
  +        html.Write '>'
  +
  +        match child with
  +        | Some c -> html.Write c
  +        | None ->
  +          for child in children do
  +            writeTo html (castHTMLNode child)
  +
  +        html.Write "</"
  +        html.Write tag
  +        html.Write '>'
  +    | HTMLNode.List nodes ->
  +        for node in nodes do
  +          writeTo html (castHTMLNode node)
  +    | HTMLNode.Empty -> ()
  +
   let renderToString (htmlNode: ReactElement): string =
     let htmlNode = addReactMark (castHTMLNode htmlNode)
  -  let html = StringBuilder()
  -
  -  let rec render (htmlNode: HTMLNode) : unit =
  -    match htmlNode with
  -    | HTMLNode.Text str -> escapeHtml html str
  -    | HTMLNode.RawText str -> html.Append str |> ignore
  -    | HTMLNode.Node (tag, attrs, children) ->
  -      html.Append '<' |> ignore
  -      html.Append tag |> ignore
  -
  -      let child = renderAttrs html attrs tag
  -
  -      if voidTags.Contains tag then
  -        html.Append "/>" |> ignore
  -      else
  -        html.Append '>' |> ignore
  -
  -        match child with
  -        | Some c -> html.Append c |> ignore
  -        | None ->
  -          for child in children do
  -            render (castHTMLNode child)
  -
  -        html.Append "</" |> ignore
  -        html.Append tag |> ignore
  -        html.Append '>' |> ignore
  -    | HTMLNode.List nodes ->
  -        for node in nodes do
  -          render (castHTMLNode node)
  -    | HTMLNode.Empty -> ()
  -
  -  render htmlNode
  +  use html = new StringWriter()
  +  htmlNode |> writeTo html 
     html.ToString()
  
positive.code:   | Unselectable v -> boolAttr html "unselectable" v
    #if !FABLE_COMPILER
    | Style cssList ->
      html.Append "style" |> ignore
      html.Append "=\"" |> ignore
  
      for cssProp in cssList do
        renderCssProp html cssProp
      if not(List.isEmpty cssList) then
        html.Remove (html.Length - 1, 1) |> ignore
      html.Append '"' |> ignore
  
    | HTMLAttr.Custom (key, value) -> strAttr html (key.ToLower()) (string value)
    | Data (key, value) -> strAttr html ("data-" + key) (string value)
    #endif
  
  let private renderSVGAttr (html:StringBuilder) (attr: SVGAttr) =
    match attr with
    | SVGAttr.ClipPath v -> objAttr html "clip-path" v
    | SVGAttr.Cx v -> objAttr html "cx" v
  
negative.code:   | CSSProp.Custom (key, value) -> cssProp html (slugKey key) value
    #endif
  
  let inline boolAttr (html:TextWriter) (key: string) (value: bool) = if value then html.Write key
  
  let inline strAttr (html:TextWriter) (key: string) (value: string) =
    html.Write key
    html.Write "=\""
    escapeHtml html value
    html.Write '"'
  
  let inline objAttr (html:TextWriter) (key: string) (value: obj) = strAttr html key (string value)
  
  let private renderHtmlAttr (html:TextWriter) (attr: HTMLAttr) =
    match attr with
    | DefaultChecked v | Checked v -> boolAttr html "checked" v
    | DefaultValue v |  Value v -> strAttr html "value" v
  