Skip to content

Commit ccf6f11

Browse files
committed
Reactpy 1.1 allows usage of NoneType
1 parent be30c9b commit ccf6f11

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

requirements/pkg-deps.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
channels >=4.0.0
22
django >=4.2.0
3-
reactpy >=1.0.2, <1.1.0
3+
reactpy >=1.1.0, <1.2.0
44
reactpy-router >=1.0.0, <2.0.0
55
dill >=0.3.5
66
orjson >=3.6.0

src/reactpy_django/decorators.py

+2-6
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313
from django.contrib.auth.models import AbstractUser
1414

1515

16-
17-
1816
def user_passes_test(
1917
test_func: Callable[[AbstractUser], bool],
2018
/,
@@ -59,7 +57,5 @@ def _user_passes_test(component_constructor, fallback, test_func, *args, **kwarg
5957
# Render the component.
6058
return user_component
6159

62-
# Render the fallback component.
63-
# Returns an empty string if fallback is None, since ReactPy currently renders None as a string.
64-
# TODO: Remove this fallback when ReactPy can render None properly.
65-
return fallback(*args, **kwargs) if callable(fallback) else (fallback or "")
60+
# Render the fallback content.
61+
return fallback(*args, **kwargs) if callable(fallback) else (fallback or None)

0 commit comments

Comments
 (0)