@@ -60,9 +60,6 @@ let attributes_to_string attrs =
60
60
| [] -> " "
61
61
| rest -> " " ^ (rest |> String. concat " " |> String. trim)
62
62
63
- let react_root_attr_name = " data-reactroot"
64
- let data_react_root_attr = Printf. sprintf " %s=\"\" " react_root_attr_name
65
-
66
63
type mode = String | Markup
67
64
68
65
let render_to_string ~mode element =
@@ -74,9 +71,6 @@ let render_to_string ~mode element =
74
71
<!-- --> between text nodes *)
75
72
let previous_was_text_node = ref false in
76
73
let rec render_element element =
77
- let root_attribute =
78
- match is_root.contents with true -> data_react_root_attr | false -> " "
79
- in
80
74
match element with
81
75
| Empty -> " "
82
76
| Provider children -> render_element children
@@ -88,11 +82,10 @@ let render_to_string ~mode element =
88
82
| Lower_case_element { tag; attributes; _ }
89
83
when Html. is_self_closing_tag tag ->
90
84
is_root.contents < - false ;
91
- Printf. sprintf " <%s%s%s />" tag root_attribute
92
- (attributes_to_string attributes)
85
+ Printf. sprintf " <%s%s />" tag (attributes_to_string attributes)
93
86
| Lower_case_element { tag; attributes; children } ->
94
87
is_root.contents < - false ;
95
- Printf. sprintf " <%s%s%s >%s</%s>" tag root_attribute
88
+ Printf. sprintf " <%s%s>%s</%s>" tag
96
89
(attributes_to_string attributes)
97
90
(children |> List. map render_element |> String. concat " " )
98
91
tag
0 commit comments