File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -986,12 +986,15 @@ def _setup_overlay_component(self):
986986
987987 def _setup_sticky_badge (self ):
988988 """Add the sticky badge to the app."""
989- for k , component in self ._pages .items ():
990- # Would be nice to share single sticky_badge across all pages, but
991- # it bungles the StatefulComponent compile step.
989+ from reflex .components .component import memo
990+
991+ @memo
992+ def memoized_badge ():
992993 sticky_badge = sticky ()
993994 sticky_badge ._add_style_recursive ({})
994- self ._pages [k ] = Fragment .create (sticky_badge , component )
995+ return sticky_badge
996+
997+ self .app_wraps [(0 , "StickyBadge" )] = lambda _ : memoized_badge ()
995998
996999 def _apply_decorated_pages (self ):
9971000 """Add @rx.page decorated pages to the app.
You can’t perform that action at this time.
0 commit comments