Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/soft-stamps-camp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/view-components": patch
---

Accept keyword arguments in `render_in` methods
2 changes: 1 addition & 1 deletion app/components/primer/alpha/tree_view/sub_tree_node.rb
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def initialize(
)
end

def render_in(*args, &block)
def render_in(*args, **_kwargs, &block)
super.tap do
# check this _after_ rendering so @sub_tree's slots are defined
if @node.select_variant != :none && @sub_tree.defer?
Expand Down
2 changes: 1 addition & 1 deletion app/components/primer/alpha/tree_view/visual.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def initialize(id:, visual:, label: nil)
@label = label
end

def render_in(_view_context, &block)
def render_in(_view_context, **_kwargs, &block)
block&.call(@visual)
super
end
Expand Down
2 changes: 1 addition & 1 deletion app/components/primer/beta/button_group.rb
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def initialize(menu_arguments: {}, button_arguments: {})
@button = @menu.with_show_button(icon: "triangle-down", **button_arguments)
end

def render_in(view_context, &block)
def render_in(view_context, **_kwargs, &block)
super(view_context) do
block.call(@menu, @button)
end
Comment thread
issyl0 marked this conversation as resolved.
Expand Down
2 changes: 1 addition & 1 deletion app/lib/primer/forms/acts_as_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module ActsAsComponent
module InstanceMethods
delegate :render, :content_tag, :output_buffer, :capture, to: :@view_context

def render_in(view_context, &block)
def render_in(view_context, **_kwargs, &block)
@view_context = view_context
before_render
perform_render(&block)
Expand Down
2 changes: 1 addition & 1 deletion app/lib/primer/forms/toggle_switch_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def initialize(**system_arguments)
# assumes the presence of a builder so we create our own here. A builder
# cannot be constructed without a corresponding view context, which is why
# we have to override render_in and can't create it in the initializer.
def render_in(view_context, &block)
def render_in(view_context, **_kwargs, &block)
@builder = Primer::Forms::Builder.new(
nil, nil, view_context, {}
)
Expand Down
2 changes: 1 addition & 1 deletion lib/primer/form_components.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def initialize(**system_arguments)
@system_arguments = system_arguments
end

def render_in(view_context, &block)
def render_in(view_context, **_kwargs, &block)
builder = Primer::Forms::Builder.new(
nil, nil, view_context, {}
)
Expand Down
Loading