Skip to content

Commit 7fa0c8a

Browse files
committed
return type correctness
1 parent 9c0ef11 commit 7fa0c8a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/reactpy/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ def string_to_reactpy(
109109
msg = f"Expected html to be a string, not {type(html).__name__}"
110110
raise TypeError(msg)
111111
if not html.strip():
112-
return h.div()
112+
return h.fragment()
113113
if "<" not in html or ">" not in html:
114114
msg = "Expected html string to contain HTML tags, but no tags were found."
115115
raise ValueError(msg)

tests/test_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def test_string_to_reactpy(case):
9494

9595
@pytest.mark.parametrize("source", ["", " ", "\n\t "])
9696
def test_string_to_reactpy_empty_source(source):
97-
assert utils.string_to_reactpy(source) == html.div()
97+
assert utils.string_to_reactpy(source) == html.fragment()
9898

9999

100100
@pytest.mark.parametrize("source", [123, None, object()])

0 commit comments

Comments
 (0)