Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
return type correctness
  • Loading branch information
Archmonger committed Feb 11, 2026
commit 7fa0c8a99ab4dd84739be131dbb6e55e01d629d1
2 changes: 1 addition & 1 deletion src/reactpy/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def string_to_reactpy(
msg = f"Expected html to be a string, not {type(html).__name__}"
raise TypeError(msg)
if not html.strip():
return h.div()
return h.fragment()
if "<" not in html or ">" not in html:
msg = "Expected html string to contain HTML tags, but no tags were found."
raise ValueError(msg)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def test_string_to_reactpy(case):

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


@pytest.mark.parametrize("source", [123, None, object()])
Expand Down
Loading