module ViewComponent::ComponentLocalConfig

def configure_view_component(&block)

def configure_view_component(&block)
  view_component_config.instance_eval(&block)
  view_component_config.compile_methods!
end

def inherited(child)

def inherited(child)
  child.instance_variable_set(:@__vc_config, nil)
  super
end

def view_component_config

:nocov:
def view_component_config
  @__vc_config ||= self.class.view_component_config.inheritable_copy
end

def view_component_config

def view_component_config
  @__vc_config ||= if respond_to?(:superclass) && superclass.respond_to?(:view_component_config)
    superclass.view_component_config.inheritable_copy
  else
    # create a new "anonymous" class that will host the compiled reader methods
    ViewComponent::ComponentLocalConfig::Configuration.new
  end
end