From 788cab32b6fb103252515c3f181ff7cf566a5aff Mon Sep 17 00:00:00 2001 From: Joel Hawksley Date: Mon, 24 Aug 2026 11:34:49 -0600 Subject: [PATCH 1/2] Fix ReusedInstanceError in Dropdown::Menu::Item divider rendering MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When rendering a divider item, the component was rendered twice—once for the divider branch and once for the content branch—because the divider branch was missing an early return. This produced a ViewComponent::ReusedInstanceError under view_component >= 4.x, which enforces single-use component instances. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- app/components/primer/alpha/dropdown/menu.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/components/primer/alpha/dropdown/menu.rb b/app/components/primer/alpha/dropdown/menu.rb index daf643fa90..00b85d185e 100644 --- a/app/components/primer/alpha/dropdown/menu.rb +++ b/app/components/primer/alpha/dropdown/menu.rb @@ -88,7 +88,7 @@ def call end # divider has no content - render(component) if divider? + return render(component) if divider? render(component) { content } end From a2e1e766e2d89c06fdcc043785b806634e537245 Mon Sep 17 00:00:00 2001 From: Joel Hawksley Date: Mon, 24 Aug 2026 11:37:07 -0600 Subject: [PATCH 2/2] Fix ReusedInstanceError in Dropdown::Menu::Item Fixes the ReusedInstanceError occurring during the rendering of the divider in Dropdown::Menu::Item. --- .changeset/clear-hounds-read.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/clear-hounds-read.md diff --git a/.changeset/clear-hounds-read.md b/.changeset/clear-hounds-read.md new file mode 100644 index 0000000000..151a52113b --- /dev/null +++ b/.changeset/clear-hounds-read.md @@ -0,0 +1,5 @@ +--- +"@primer/view-components": patch +--- + +Fix ReusedInstanceError in Dropdown::Menu::Item divider rendering