Skip to content

Commit

Permalink
remove hack and pass proper const for position
Browse files Browse the repository at this point in the history
  • Loading branch information
Lendemor committed Dec 13, 2024
1 parent daa1f0c commit 444e970
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ export function {{tag_name}} () {
{{ hook }}
{% endfor %}

{% for hook, data in component._get_all_hooks().items() if not data.position or data.position == positions.PRE_TRIGGER %}
{% for hook, data in component._get_all_hooks().items() if not data.position or data.position == hook_positions.PRE_TRIGGER %}
{{ hook }}
{% endfor %}

{% for hook in memo_trigger_hooks %}
{{ hook }}
{% endfor %}

{% for hook,data in component._get_all_hooks().items() if data.position and data.position == positions.POST_TRIGGER %}
{% for hook,data in component._get_all_hooks().items() if data.position and data.position == hook_positions.POST_TRIGGER %}
{{ hook }}
{% endfor %}

Expand Down
1 change: 1 addition & 0 deletions reflex/compiler/templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +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,
}


Expand Down
2 changes: 0 additions & 2 deletions reflex/components/component.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
)

import reflex.state
from reflex import constants
from reflex.base import Base
from reflex.compiler.templates import STATEFUL_COMPONENT
from reflex.components.core.breakpoints import Breakpoints
Expand Down Expand Up @@ -2169,7 +2168,6 @@ def _render_stateful_code(
tag_name=tag_name,
memo_trigger_hooks=memo_trigger_hooks,
component=component,
positions=constants.Hooks.HookPosition,
)

@staticmethod
Expand Down

0 comments on commit 444e970

Please sign in to comment.