diff --git a/apps/console/src/pages/organizations/cookie-banners/configuration/cookies/_components/CategorySection.tsx b/apps/console/src/pages/organizations/cookie-banners/configuration/cookies/_components/CategorySection.tsx index 01371ec40..3c380197d 100644 --- a/apps/console/src/pages/organizations/cookie-banners/configuration/cookies/_components/CategorySection.tsx +++ b/apps/console/src/pages/organizations/cookie-banners/configuration/cookies/_components/CategorySection.tsx @@ -154,8 +154,8 @@ export function CategorySection({ categoryKey, onDelete }: CategorySectionProps) const [updateCategory, isUpdating] = useMutation(updateCategoryMutation); - const [moveCookie, _isMoving] - = useMutation(moveCookieMutation); + const [moveCookie] = + useMutation(moveCookieMutation); const [isEditingCategory, setIsEditingCategory] = useState(false); const [editingCookieIndex, setEditingCookieIndex] = useState(null); diff --git a/contrib/claude/react-components.md b/contrib/claude/react-components.md index 576dd3785..b2d8a406a 100644 --- a/contrib/claude/react-components.md +++ b/contrib/claude/react-components.md @@ -11,6 +11,24 @@ This document describes **how to define and shape** React components in Probo fr | `@probo/ui`, Tailwind, `tailwind-variants`, folders, skeletons, compound modules | [`contrib/claude/ui.md`](ui.md) | | Relay queries, fragments, loaders, `queryRef` | [`contrib/claude/relay.md`](relay.md) | +## Destructuring + +**Never destructure a value you do not use.** If only one element of a tuple or object is needed, stop destructuring at that element or omit the unused keys. Do not assign to `_`-prefixed throwaway names. + +### Do / don't: unused destructured values + +```tsx +// Bad — _isMoving is never read +const [moveCookie, _isMoving] = + useMutation(moveCookieMutation); +``` + +```tsx +// Good — stop at the last element you need +const [moveCookie] = + useMutation(moveCookieMutation); +``` + ## Component shape | Rule | Convention |