element.py 501 B

123456789101112131415161718
  1. """Base class definition for raw HTML elements."""
  2. from reflex.components.component import Component
  3. class Element(Component):
  4. """The base class for all raw HTML elements."""
  5. def __eq__(self, other: object):
  6. """Two elements are equal if they have the same tag.
  7. Args:
  8. other: The other element.
  9. Returns:
  10. True if the elements have the same tag, False otherwise.
  11. """
  12. return isinstance(other, Element) and self.tag == other.tag