Link components are containers - it’s a way to allow any component to be clickable.
Since it’s a container it makes sense that it would inherit from another container so that methods like add_component
can be inherited. And would also make sense to be able to loop over a link’s child components in the same way.
While it’s not obvious that this is the case - the api reference does provide the base class for each anvil component:
And you’d be forgiven for thinking that the Link component inherited from LinearPanel since that’s what’s listed in the docs -
- there seem to be some hangovers from this inheritance in the autocomplete (index comes up when you call add component for example)
I’m sure you came up with an alternative code snippet but you might use if type(component) is Link: