module ViewComponent::Slotable

def inherited(child)

def inherited(child)
  # Clone slot configuration into child class
  # see #test_slots_pollution
  child.registered_slots = registered_slots.clone
  # Add a module for slot methods, allowing them to be overriden by the component class
  # see #test_slot_name_can_be_overriden
  unless child.const_defined?(:GeneratedSlotMethods, false)
    generated_slot_methods = Module.new
    child.const_set(:GeneratedSlotMethods, generated_slot_methods)
    child.include generated_slot_methods
  end
  super
end