Skip to content

Commit

Permalink
experiment: use useControlled
Browse files Browse the repository at this point in the history
  • Loading branch information
manuel-rw committed Jan 5, 2025
1 parent 37050a8 commit cd8f314
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion apps/nextjs/src/components/icons/picker/icon-picker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
UnstyledButton,
useCombobox,
} from "@mantine/core";
import { useDebouncedValue } from "@mantine/hooks";
import { useDebouncedValue, useUncontrolled } from "@mantine/hooks";
import { IconUpload } from "@tabler/icons-react";

import { clientApi } from "@homarr/api/client";
Expand All @@ -40,6 +40,7 @@ export const IconPicker = ({ initialValue, onChange, error, onFocus, onBlur }: I
const [search, setSearch] = useState(initialValue ?? "");
const [previewUrl, setPreviewUrl] = useState<string | null>(initialValue ?? null);
const { data: session } = useSession();
const [a, b] = useUncontrolled({ value, onChange, defaultValue: initialValue });

Check warning on line 43 in apps/nextjs/src/components/icons/picker/icon-picker.tsx

View workflow job for this annotation

GitHub Actions / lint

Identifier name 'a' is too short (< 3)

Check failure on line 43 in apps/nextjs/src/components/icons/picker/icon-picker.tsx

View workflow job for this annotation

GitHub Actions / lint

'a' is assigned a value but never used. Allowed unused vars must match /^_/u

Check warning on line 43 in apps/nextjs/src/components/icons/picker/icon-picker.tsx

View workflow job for this annotation

GitHub Actions / lint

Identifier name 'b' is too short (< 3)

Check failure on line 43 in apps/nextjs/src/components/icons/picker/icon-picker.tsx

View workflow job for this annotation

GitHub Actions / lint

'b' is assigned a value but never used. Allowed unused vars must match /^_/u

const tCommon = useScopedI18n("common");

Expand Down

0 comments on commit cd8f314

Please sign in to comment.