@@ -200,16 +200,17 @@ def __getattr__(self, name: str) -> Any:
200200 if hasattr (self , "_modules" ) and name in self ._modules :
201201 return self ._modules [name ]
202202
203- # Check if this is a deprecated hook alias
204- resolved_hook = resolve_alias (self , name , self .hook_aliases )
205- if resolved_hook is not None and self .compatibility_mode == True :
206- return resolved_hook
207-
208- # If we reach here, we can resolve the alias normally
209- resolved_property = resolve_alias (self , name , self .property_aliases )
210-
211- if resolved_property is not None and self .compatibility_mode == True :
212- return resolved_property
203+ # Only try to resolve aliases if compatibility mode is enabled
204+ if self .compatibility_mode == True :
205+ # Check if this is a deprecated hook alias
206+ resolved_hook = resolve_alias (self , name , self .hook_aliases )
207+ if resolved_hook is not None :
208+ return resolved_hook
209+
210+ # Check if this is a deprecated property alias
211+ resolved_property = resolve_alias (self , name , self .property_aliases )
212+ if resolved_property is not None :
213+ return resolved_property
213214
214215 # Avoid recursion by checking if we're looking for original_component
215216 if name == "original_component" :
0 commit comments