Skip to content

Commit 196333f

Browse files
committed
ENG-7583: check against base component for style
1 parent 367b24d commit 196333f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

reflex/style.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,11 @@ def convert_item(
120120
Raises:
121121
ReflexError: If an EventHandler is used as a style value
122122
"""
123-
if isinstance(style_item, EventHandler):
123+
from reflex.components.component import BaseComponent
124+
125+
if isinstance(style_item, (EventHandler, BaseComponent)):
124126
msg = (
125-
"EventHandlers cannot be used as style values. "
127+
f"{type(style_item)} cannot be used as style values. "
126128
"Please use a Var or a literal value."
127129
)
128130
raise ReflexError(msg)

0 commit comments

Comments
 (0)