From fb4d22a1e3c60ce2c4906e112eea0612fd86af1a Mon Sep 17 00:00:00 2001 From: Masen Furer Date: Fri, 13 Dec 2024 12:39:32 -0800 Subject: [PATCH] use "hook_position" instead of "hook_positions" match the name of the enum --- .../.templates/jinja/web/pages/stateful_component.js.jinja2 | 4 ++-- reflex/compiler/templates.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/reflex/.templates/jinja/web/pages/stateful_component.js.jinja2 b/reflex/.templates/jinja/web/pages/stateful_component.js.jinja2 index 72bc7a4b64..b04a787815 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 488117953c..631aa4ee2d 100644 --- a/reflex/compiler/templates.py +++ b/reflex/compiler/templates.py @@ -45,7 +45,7 @@ def __init__(self) -> None: "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, }