Skip to content

fix(ui): fix rules of hooks violations via useId - #1872

Draft
franzheidl wants to merge 2 commits into
mainfrom
franz-fix-rules-of-hooks-1589
Draft

fix(ui): fix rules of hooks violations via useId#1872
franzheidl wants to merge 2 commits into
mainfrom
franz-fix-rules-of-hooks-1589

Conversation

@franzheidl

@franzheidl franzheidl commented Aug 7, 2026

Copy link
Copy Markdown
Member

-- WIP UNTESTED, DO NOT MERGE --

Summary

Fix all useId-related violations of Rules of Hooks: Call hooks only on top level

Changes Made

  • CheckboxGroup — replaced uniqueId() wrapper with two top-level calls generatedName = useId() and generatedId = useId(); used inline in groupName and groupId assignments
  • ComboBox — extracted generatedId = useId() to top level; split off from the conditional theId assignment; helptextId was already unconditional so unchanged
  • RadioGroup — same as CheckboxGroup: two separate top-level useId() calls for generatedName and generatedId
  • SecretText — removed uniqueId arrow function; replaced with top-level generatedId = useId() used in theId assignment
  • Select — removed uniqueId arrow function; replaced with top-level generatedId = useId() used in theId assignment; helptextId was already unconditional so unchanged
  • Switch — removed generateUniqueId arrow function; replaced with top-level generatedId = useId(); introduced theId combining id and generatedId; updated id and htmlFor usages in JSX from generatedId to theId
  • TextInput — removed uniqueId arrow function; replaced with top-level generatedId = useId() used in theId assignment
  • Textarea — removed uniqueId arrow function; replaced with top-level generatedId = useId() used in theId assignment

Related Issues

Closes #1589

Testing Instructions

  1. pnpm i
  2. pnpm run test

Checklist

  • I have performed a self-review of my code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.
  • I have made corresponding changes to the documentation (if applicable).
  • My changes generate no new warnings or errors.
  • I have created a changeset for my changes.

PR Manifesto

Review the PR Manifesto for best practises.

@changeset-bot

changeset-bot Bot commented Aug 7, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 104ca4e

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1

🚀 View preview at
https://cloudoperators.github.io/juno/pr-preview/pr-1872/

Built to branch gh-pages at 2026-08-07 15:30 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@franzheidl franzheidl changed the title Franz fix rules of hooks 1589 fix(ui): fix rules of hooks violations via useId Aug 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Task](ui): fix useId-related Rules of Hooks violations across form components

1 participant