Skip to content

Commit 7ee3026

Browse files
authored
do not compile stateful components in dev mode (#6199)
* exp isinstance check * what are we doing here
1 parent 6767870 commit 7ee3026

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

reflex/compiler/compiler.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -410,11 +410,7 @@ def _get_shared_components_recursive(
410410
# When the component is referenced by more than one page, render it
411411
# to be included in the STATEFUL_COMPONENTS module.
412412
# Skip this step in dev mode, thereby avoiding potential hot reload errors for larger apps
413-
if (
414-
isinstance(component, StatefulComponent)
415-
and component.references > 1
416-
and is_prod_mode()
417-
):
413+
if isinstance(component, StatefulComponent) and component.references > 1:
418414
# Reset this flag to render the actual component.
419415
component.rendered_as_shared = False
420416

@@ -620,7 +616,7 @@ def compile_stateful_components(
620616
progress_function()
621617
page_components.append(page_component)
622618

623-
code = _compile_stateful_components(page_components)
619+
code = _compile_stateful_components(page_components) if is_prod_mode() else ""
624620
return output_path, code, page_components
625621

626622

0 commit comments

Comments
 (0)