Skip to content

Fix linting errors from eslint-plugin-react-hooks v7 upgrade#456

Closed
Copilot wants to merge 3 commits into
renovate/major-eslintfrom
copilot/sub-pr-447
Closed

Fix linting errors from eslint-plugin-react-hooks v7 upgrade#456
Copilot wants to merge 3 commits into
renovate/major-eslintfrom
copilot/sub-pr-447

Conversation

Copy link
Copy Markdown

Copilot AI commented Nov 18, 2025

The v7 upgrade introduces stricter rules around ref access, mutations, and component creation during render. All violations have been addressed while preserving existing behavior.

Changes by category

Ref access during render

  • useElementVisible, useStickyIntersectionObserver: Accept refs instead of ref.current
  • Feel.js (5 instances), FeelEditor.js, TemplatingEditor.js: Wrap ref assignments in useEffect
  • Tooltip.js: Move position calculation to state with useEffect
  • DropdownButton.js: Pass refs to useGlobalClick, dereference inside effect

Ref naming convention

  • Renamed refs accessed in event handlers to end in Ref suffix per v7 hint:
    • timeouttimeoutRef in Tooltip.js
    • isAutoCompletionOpenisAutoCompletionOpenRef in FeelPopup.js
    • contextcontextRef in Popup.js
    • isMountedisMountedRef in PropertiesPanel.js
    • focusfocusRef in useShowEntryEvent.js
    • didMountdidMountRef in useEvent.js

Hook rewrites

  • usePrevious: Use state + ref to avoid returning ref.current during render
  • useEvent: Simplify to effect-only subscription (remove immediate subscription pattern)
  • useStaticCallback: Move callbackRef.current assignment to useEffect

Component creation

  • Header.js: Memoize icon element creation instead of component reference

Example fix pattern

Before (v6):

const visible = useElementVisible(ref.current);

After (v7):

const visible = useElementVisible(ref);

// In useElementVisible hook:
useLayoutEffect(() => {
  const element = ref.current;
  // ... use element
}, [ref]);

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@bpmn-io-tasks bpmn-io-tasks Bot added the in progress Currently worked on label Nov 18, 2025
@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Co-authored-by: barmac <28307541+barmac@users.noreply.github.com>
Copy link
Copy Markdown
Author

Copilot AI commented Nov 18, 2025

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • googlechromelabs.github.io
    • Triggering command: node install.mjs (dns block)
  • https://storage.googleapis.com/chrome-for-testing-public/131.0.6778.264/linux64/chrome-linux64.zip
    • Triggering command: node install.mjs (http block)
  • www-api.ibm.com
    • Triggering command: node /home/REDACTED/work/properties-panel/properties-panel/node_modules/@ibm/telemetry-js/dist/REDACTED-process.js --log=/tmp/ibmtelemetry-20251118T124406128Z-662902.log --config=telemetry.yml (dns block)
    • Triggering command: node /home/REDACTED/work/properties-panel/properties-panel/node_modules/@ibm/telemetry-js/dist/REDACTED-process.js --log=/tmp/ibmtelemetry-20251118T124458558Z-795702.log --config=telemetry.yml (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title [WIP] Update dependency eslint-plugin-react-hooks to v7 Fix linting errors from eslint-plugin-react-hooks v7 upgrade Nov 18, 2025
Copilot AI requested a review from barmac November 18, 2025 13:11
@renovate renovate Bot force-pushed the renovate/major-eslint branch from 536d558 to f112640 Compare November 18, 2025 23:59
@renovate renovate Bot force-pushed the renovate/major-eslint branch from f112640 to 3a99430 Compare December 3, 2025 19:11
@nikku nikku mentioned this pull request Dec 14, 2025
6 tasks
@renovate renovate Bot force-pushed the renovate/major-eslint branch from 3a99430 to bb13264 Compare December 16, 2025 09:53
@renovate renovate Bot force-pushed the renovate/major-eslint branch from bb13264 to 3305974 Compare December 31, 2025 14:55
@barmac barmac closed this Jan 13, 2026
@bpmn-io-tasks bpmn-io-tasks Bot removed the in progress Currently worked on label Jan 13, 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.

3 participants