@@ -1021,48 +1021,12 @@ def get_initial_props(cls) -> set[str]:
10211021 """
10221022 return set ()
10231023
1024- @classmethod
1025- def _are_fields_known (cls ) -> bool :
1026- """Check if all fields are known at compile time. True for most components.
1027-
1028- Returns:
1029- Whether all fields are known at compile time.
1030- """
1031- return True
1032-
1033- @classmethod
1034- @functools .cache
1035- def _get_component_prop_names (cls ) -> set [str ]:
1036- """Get the names of the component props. NOTE: This assumes all fields are known.
1037-
1038- Returns:
1039- The names of the component props.
1040- """
1041- return {
1042- name
1043- for name in cls .get_fields ()
1044- if name in cls .get_props ()
1045- and isinstance (
1046- field_type := types .value_inside_optional (
1047- types .get_field_type (cls , name )
1048- ),
1049- type ,
1050- )
1051- and issubclass (field_type , Component )
1052- }
1053-
10541024 def _get_components_in_props (self ) -> Sequence [BaseComponent ]:
10551025 """Get the components in the props.
10561026
10571027 Returns:
10581028 The components in the props
10591029 """
1060- if self ._are_fields_known ():
1061- return [
1062- component
1063- for name in self ._get_component_prop_names ()
1064- for component in _components_from (getattr (self , name ))
1065- ]
10661030 return [
10671031 component
10681032 for prop in self .get_props ()
@@ -2060,15 +2024,6 @@ def get_args_spec(key: str) -> types.ArgsSpec | Sequence[types.ArgsSpec]:
20602024 self .props [camel_cased_key ] = value
20612025 setattr (self , camel_cased_key , value )
20622026
2063- @classmethod
2064- def _are_fields_known (cls ) -> bool :
2065- """Check if the fields are known.
2066-
2067- Returns:
2068- Whether the fields are known.
2069- """
2070- return False
2071-
20722027 def __eq__ (self , other : Any ) -> bool :
20732028 """Check if the component is equal to another.
20742029
0 commit comments