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.
Follow-up from #6949 (auto-memoize
@rx.memocall sites with stateful props). Cosmetic only.Problem
The generated wrapper around a user
@rx.memocomponent gets a tag like:The inner tag appears twice. The name is noisy in compiled
app_components/*.jsxoutput, React DevTools, and stack traces.Cause
Component._compute_memo_tag()(packages/reflex-base/src/reflex_base/components/component.py) builds the prefix asf"{type(self).__qualname__}_{self.tag or 'Comp'}_{comp_hash}". For aMemoComponentinstance,type(self)is the dynamic subclass from_get_memo_component_class, whose__qualname__equals itstag(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_98ffd1e1is the module suffix added a second time by_create_component_definition.Suggested fix
In
_compute_memo_tag, skip theself.tagsegment when it equalstype(self).__qualname__(or override_compute_memo_tagonMemoComponentto useMemocomponent_{tag}_{hash}). Keep the class identity in the name so the collision guarantee from the docstring holds. Add a unit test intests/units/compiler/test_memoize_plugin.pyasserting the wrapper tag for a user memo contains the inner tag once.Repro
Any
@rx.memocomponent called with a state Var prop; inspect.web/app_components/<app>/<app>.jsxafterreflex run.