Skip to content

A full-featured CRM built with React, shadcn/ui, and Supabase.

Remove useless component

fzaninotto8f09517e7329
diff --git a/registry.json b/registry.json
index 1d614e3e..91273aef 100644
--- a/registry.json
+++ b/registry.json
@@ -669,10 +669,6 @@
{
"path": "src/hooks/simple-form-iterator-context.tsx",
"type": "registry:hook"
- },
- {
- "path": "src/hooks/array-input-context.tsx",
- "type": "registry:hook"
}
]
}
diff --git a/src/hooks/array-input-context.tsx b/src/hooks/array-input-context.tsx
deleted file mode 100644
index d40045f2..00000000
--- a/src/hooks/array-input-context.tsx
+++ /dev/null
@@ -1,53 +0,0 @@
-import { createContext, useContext, useMemo } from "react";
-import type { UseFieldArrayReturn } from "react-hook-form";
-
-/**
- * A React context that provides access to an ArrayInput methods as provided by react-hook-form
- * Useful to create custom array input iterators.
- * @deprecated Use ArrayInputContext from `ra-core` once available.
- * @see {ArrayInput}
- * @see {@link https://react-hook-form.com/docs/usefieldarray}
- */
-export const ArrayInputContext = createContext<
- ArrayInputContextValue | undefined
->(undefined);
-
-/**
- * @deprecated Use ArrayInputContextValue from `ra-core` once available.
- */
-export type ArrayInputContextValue = UseFieldArrayReturn;
-
-/**
- * @deprecated Use useArrayInput from `ra-core` once available.
- */
-export const useArrayInput = (
- props?: Partial<ArrayInputContextValue>,
-): ArrayInputContextValue => {
- const context = useContext(ArrayInputContext);
- const memo = useMemo(
- () =>
- ({
- append: props?.append,
- fields: props?.fields,
- insert: props?.insert,
- move: props?.move,
- prepend: props?.prepend,
- remove: props?.remove,
- replace: props?.replace,
- swap: props?.swap,
- update: props?.update,
- }) as ArrayInputContextValue,
- [props],
- );
-
- if (props?.fields) {
- return memo;
- }
- if (!context) {
- throw new Error(
- "useArrayInput must be used inside an ArrayInputContextProvider",
- );
- }
-
- return context;
-};