Conversation
- Remove ActionList from the React Compiler unsupported list - Fix Rules of Hooks violation in ChildWithSideEffects story by moving SideEffectDescription to module scope
|
|
👋 Hi, this pull request contains changes to the source code that github/github-ui depends on. If you are GitHub staff, test these changes with github/github-ui using the integration workflow. Or, apply the |
Summary
Enable React Compiler for ActionList — the foundational component used by ActionMenu, SelectPanel, NavList, and FilteredActionList.
ActionList was originally excluded from the compiler during the initial migration. After analysis (build, lint with
eslint-plugin-react-compiler, and manual Storybook verification), all ActionList source files are fully compiler-compatible. The only fix needed was a Rules of Hooks violation in a story file.Changes
src/ActionList/**/*.tsxfrom the React Compiler unsupported list inreact-compiler.mjsChildWithSideEffectsstory — movedSideEffectDescriptionto module scope to comply with the Rules of HooksWhy this matters
ActionList is the most-rendered list component in the design system. With the compiler enabled, React will automatically memoize ActionList's components (
Item,List,Group,Selection,Visuals, etc.), reducing unnecessary re-renders without any manualReact.memo/useMemo/useCallbackwork.How did you test this change?
Lint — Ran
npx eslintwithreact-compiler/react-compilerrule on all ActionList files (source, stories, tests): 0 warningsBuild —
npx turbo build --filter=@primer/react --forcepasses cleanly with ActionList compiledStorybook — Verified the following stories render correctly with zero console warnings: