Skip to content

Commit eea00a4

Browse files
Update packages/reflex-base/src/reflex_base/utils/lazy_loader.py
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
1 parent 3c8da1b commit eea00a4

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

packages/reflex-base/src/reflex_base/utils/lazy_loader.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,12 @@ def comp_name(comp: str | tuple[str, str]) -> str:
113113
return comp[0] if isinstance(comp, tuple) else comp
114114

115115

116+
def comp_alias(comp: str | tuple[str, str]) -> str:
117+
"""Get the component alias from the mapping value.
118+
119+
This is the name external users will import.
120+
121+
Args:
116122
def comp_alias(comp: str | tuple[str, str]) -> str:
117123
"""Get the component alias from the mapping value.
118124

@@ -122,9 +128,8 @@ def comp_alias(comp: str | tuple[str, str]) -> str:
122128
comp: The component name or a tuple of (component name, alias).
123129

124130
Returns:
125-
The component alias, or None if there is no alias.
131+
The component alias, or the component name itself if there is no alias.
126132
"""
127-
return comp[1] if isinstance(comp, tuple) else comp
128133
129134
130135
def comp_path(path: str, comp: str | tuple[str, str]) -> str:

0 commit comments

Comments
 (0)