Skip to content

Commit 7129bfb

Browse files
Lendemormasenf
authored andcommitted
allow for 'go.Figure | None' annotation in State (#4426)
1 parent b41b1f3 commit 7129bfb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

reflex/components/plotly/plotly.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ def _exclude_props(self) -> set[str]:
255255

256256
def _render(self):
257257
tag = super()._render()
258-
figure = self.data.to(dict)
258+
figure = self.data.to(dict) if self.data is not None else {}
259259
merge_dicts = [] # Data will be merged and spread from these dict Vars
260260
if self.layout is not None:
261261
# Why is this not a literal dict? Great question... it didn't work

0 commit comments

Comments
 (0)