UNPKG

rhf-error-util

Version:

Lightweight utility hook for safely accessing errors in react-hook-form (nested or flat)

22 lines (15 loc) 783 B
# rhf-error-util > Lightweight utility for safely accessing deeply nested or flat error objects like in React Hook Form. [![npm version](https://img.shields.io/npm/v/rhf-error-util)](https://www.npmjs.com/package/rhf-error-util) [![license: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE) [![types: TypeScript](https://img.shields.io/badge/types-TypeScript-blue.svg)](https://www.typescriptlang.org/) [![minzipped size](https://badgen.net/bundlephobia/minzip/rhf-error-util)](https://bundlephobia.com/result?p=rhf-error-util) ## ✨ Features - Zero dependencies - Works with nested keys (e.g., `"object.keys.keys"`) - Returns `{ message, ref, type }` object - Can be used with or without React Hook Form ## 🚀 Install ```bash npm install rhf-error-util ```