USACE / USACE/groundwork

Accordion Fragment Error with React 19

Open Beginner friendly
#299 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
JavaScript
Stars
6
Forks
4
PR merge metrics
No merged PRs in 30d

Description

Describe the bug

I am receiving this error on the Accordion component after updating from React 18 to 19: "Invalid prop data-headlessui-state supplied to React.Fragment. React.Fragment can only have key and children props."

Gemini thinks that the issue is related to passing a fragment to the element, which is no longer allowed in React 19. https://github.com/USACE/groundwork/blob/main/lib/components/display/accordion.jsx.

I think the specific issue is on Line 24 "<>". Replacing the <></> with a

tag may fix the issue, or adding an as="div" to the Disclosure tag. I haven't tried either, however.

REDACTED relevant log output

Steps to Reproduce

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with lib/components/display/accordion.jsx, especially the fragment on line 24, and inspect how Accordion passes props to Disclosure under React 19. Reproduce the reported data-headlessui-state error, then verify the chosen fix by confirming the error no longer occurs.

Written by the indexing model from the issue text.

Assessment

Tech stack
react
Domain
frontend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.