diff --git a/reflex/.templates/jinja/web/pages/stateful_component.js.jinja2 b/reflex/.templates/jinja/web/pages/stateful_component.js.jinja2 index 72bc7a4b6..b04a78781 100644 --- a/reflex/.templates/jinja/web/pages/stateful_component.js.jinja2 +++ b/reflex/.templates/jinja/web/pages/stateful_component.js.jinja2 @@ -5,7 +5,7 @@ export function {{tag_name}} () { {{ hook }} {% endfor %} - {% for hook, data in component._get_all_hooks().items() if not data.position or data.position == const.hook_positions.PRE_TRIGGER %} + {% for hook, data in component._get_all_hooks().items() if not data.position or data.position == const.hook_position.PRE_TRIGGER %} {{ hook }} {% endfor %} @@ -13,7 +13,7 @@ export function {{tag_name}} () { {{ hook }} {% endfor %} - {% for hook,data in component._get_all_hooks().items() if data.position and data.position == const.hook_positions.POST_TRIGGER %} + {% for hook, data in component._get_all_hooks().items() if data.position and data.position == const.hook_position.POST_TRIGGER %} {{ hook }} {% endfor %} diff --git a/reflex/compiler/templates.py b/reflex/compiler/templates.py index 488117953..631aa4ee2 100644 --- a/reflex/compiler/templates.py +++ b/reflex/compiler/templates.py @@ -45,7 +45,7 @@ class ReflexJinjaEnvironment(Environment): "on_load_internal": constants.CompileVars.ON_LOAD_INTERNAL, "update_vars_internal": constants.CompileVars.UPDATE_VARS_INTERNAL, "frontend_exception_state": constants.CompileVars.FRONTEND_EXCEPTION_STATE_FULL, - "hook_positions": constants.Hooks.HookPosition, + "hook_position": constants.Hooks.HookPosition, }