fix(papeleria): mover useMemo antes del return condicional para evitar error #310
This commit is contained in:
@@ -229,6 +229,13 @@ export function PapeleriaTab() {
|
|||||||
onSuccess: invalidate,
|
onSuccess: invalidate,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const items = query.data ?? [];
|
||||||
|
const años = useMemo(() => {
|
||||||
|
const set = new Set<number>([currentYear]);
|
||||||
|
items.forEach(i => set.add(i.anio));
|
||||||
|
return [...set].sort((a, b) => b - a);
|
||||||
|
}, [items, currentYear]);
|
||||||
|
|
||||||
if (!selectedContribuyenteId) {
|
if (!selectedContribuyenteId) {
|
||||||
return (
|
return (
|
||||||
<Card>
|
<Card>
|
||||||
@@ -239,13 +246,6 @@ export function PapeleriaTab() {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const items = query.data ?? [];
|
|
||||||
const años = useMemo(() => {
|
|
||||||
const set = new Set<number>([currentYear]);
|
|
||||||
items.forEach(i => set.add(i.anio));
|
|
||||||
return [...set].sort((a, b) => b - a);
|
|
||||||
}, [items, currentYear]);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="space-y-4">
|
<div className="space-y-4">
|
||||||
{/* Filtros + upload */}
|
{/* Filtros + upload */}
|
||||||
|
|||||||
Reference in New Issue
Block a user