Auto-memo wrapper tags for @rx.memo components repeat the inner tag
@LeonxLJX is already working on this.
Since Aug 28, 2026.
Assessment
This issue has not been assessed yet.
Description
Follow-up from #6949 (auto-memoize @rx.memo call sites with stateful props). Cosmetic only.
Problem
The generated wrapper around a user @rx.memo component gets a tag like:
Memocomponent_card_98ffd1e1_card_98ffd1e1_e52460d9ed338b99ee51cd718b2b8fa7_98ffd1e1
The inner tag appears twice. The name is noisy in compiled app_components/*.jsx output, React DevTools, and stack traces.
Cause
Component._compute_memo_tag() (packages/reflex-base/src/reflex_base/components/component.py) builds the prefix as f"{type(self).__qualname__}_{self.tag or 'Comp'}_{comp_hash}". For a MemoComponent instance, type(self) is the dynamic subclass from _get_memo_component_class, whose __qualname__ equals its tag (Card_98ffd1e1), so the qualname and tag segments are identical. The qualname is there to keep distinct classes with identical render output from colliding; for memo subclasses the tag already carries that identity. The trailing _98ffd1e1 is the module suffix added a second time by _create_component_definition.
Suggested fix
In _compute_memo_tag, skip the self.tag segment when it equals type(self).__qualname__ (or override _compute_memo_tag on MemoComponent to use Memocomponent_{tag}_{hash}). Keep the class identity in the name so the collision guarantee from the docstring holds. Add a unit test in tests/units/compiler/test_memoize_plugin.py asserting the wrapper tag for a user memo contains the inner tag once.
Repro
Any @rx.memo component called with a state Var prop; inspect .web/app_components/<app>/<app>.jsx after reflex run.
- Dominant language
- Python
- Stars
- 28.9k
- Forks
- 1.8k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 173
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from reflex-dev/reflex
-
Difficulty 1/5 1-3 hours Newbie friendliness 78/100
reflex-dev/reflex#7149 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
reflex-dev/reflex#7148 · 1 comment ·
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
reflex-dev/reflex#7103 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
reflex-dev/reflex#6823 · 1 comment ·
-
support redis v8 Openfeature request
Difficulty 1/5 Under an hour Newbie friendliness 88/100
reflex-dev/reflex#6764 · 3 comments · 1 reaction ·
All issues in reflex-dev/reflex
Similar issues
-
documentation help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
simonw/sqlite-utils#872 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100