fix(customer-modal): replace Mantine Autocomplete with native input (React 19 ref warning)#1662
Open
giladresisi wants to merge 1 commit into
Open
fix(customer-modal): replace Mantine Autocomplete with native input (React 19 ref warning)#1662giladresisi wants to merge 1 commit into
giladresisi wants to merge 1 commit into
Conversation
…o fix React 19 warning
The CustomerModal rendered `@mantine/core`'s `<Autocomplete>`, which triggered a
React 19 console error ("Accessing element.ref was removed in React 19. ref is now
a regular prop.") whenever the modal opened (e.g. adding a channel to a new group).
The root cause is `@mantine/core@5.10.5` (Mantine v5, built for React 17/18) running
under React 19, where the library internally accesses the now-removed `element.ref`.
Replaced the single Autocomplete usage with a native `<input>` + `<datalist>`,
styled to match the app's inputs. Free-text entry (needed to create a new
customer/group) and existing-name suggestions are preserved. Scoped entirely to
customer.modal.tsx; no dependency or behavior changes elsewhere.
The alternative was to upgrade @mantine/core to a React 19-compatible major (v8),
which was clearly unfavorable: Mantine is used in only two files, the project's
convention is to prefer native components over npm UI libraries, and a v5->v8 bump
is a large breaking change carrying far more risk than removing one component.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Contribution-checker quality warning Heuristics that flagged:
If this is a genuine contribution, please add detail to your PR description and tighten the diff scope before reviewers look at it. |
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why this change (the problem)
Opening the Customer modal — e.g. when adding a channel into a new group — throws a React 19 console error:
Origin:
src/components/launches/customer.modal.tsxrendering@mantine/core's<Autocomplete>. The real cause is@mantine/core@5.10.5(Mantine v5, built for React 17/18) running under React 19.2.4 — the library internally accesses the now-removedelement.ref. It's a console error (not a hard crash), but it's noisy and user-visible in dev.The fix
Replace the single
<Autocomplete>with a native<input>+<datalist>, styled to match the app's existing inputs. Preserves the important behaviors:GET /integrations/customersSave/remove logic and the
PUT /integrations/:id/customer-nameendpoint are untouched.Why this solution (and not upgrading Mantine)
The alternative was to bump
@mantine/coreto a React 19-compatible major (v8). That was clearly unfavorable:So we removed the component instead of dragging in a major dependency upgrade.
Scope & risk
customer.modal.tsx).@mantine/corestays inpackage.json(still used bylayout/language.component.tsx), so no dependency/build impact elsewhere.element.refwarning can still originate fromlanguage.component.tsx(also Mantine v5); fully removing Mantine is out of scope here.Testing
Verified manually: the console error is gone; typing shows existing customer suggestions; typing a new name + Save creates/assigns the group and persists; opening for an already-assigned channel pre-fills the name and "Remove from customer" works; empty save is a no-op.
🤖 Generated with Claude Code