File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -642,6 +642,28 @@ function useCSVReaderComponent<
642642 return CSVReader ;
643643}
644644
645+ /**
646+ * A React hook to use the CSVReader component.
647+ * @returns The CSVReader component.
648+ *
649+ * @template T - The type of the parsed CSV file data result, where each key
650+ * represents a column in the CSV file and each value represents the data type.
651+ * @template E - The type of the HTML element used for the input. Can be
652+ * HTMLDivElement or HTMLButtonElement. Defaults to HTMLDivElement.
653+ *
654+ * @example HTMLDivElement as the input element
655+ * ```tsx
656+ * import { useCSVReader } from 'react-papaparse';
657+ * const { CSVReader } = useCSVReader();
658+ * ```
659+ * @example HTMLButtonElement as the input element
660+ * ```tsx
661+ * import { useCSVReader } from 'react-papaparse';
662+ * const { CSVReader } = useCSVReader<void, HTMLButtonElement>();
663+ * ```
664+ *
665+ * @see {@link https://react-papaparse.js.org/docs#local-files Usage with Local Files }
666+ */
645667export function useCSVReader <
646668 T = void ,
647669 E extends HTMLDivElement | HTMLButtonElement = HTMLDivElement
You can’t perform that action at this time.
0 commit comments