/
githubmirror
/
react-hook-form
Обзор
Документация
Войти
/
githubmirror
/
react-hook-form
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
src/logic/unsetEmptyArray.ts
11 строк
285 B
Masatoshi Ogiwara
🐞 fix: field array root error being lost on append/prepend/insert/remove (#13645)
08 авг 2026, 02:20
Не верифицирован
08 авг 2026, 02:20
47546bb
Код
Авторство
О чём код?
import compact from '../utils/compact'; import get from '../utils/get'; import unset from '../utils/unset'; export default <T>(ref: T, name: string) => { const array = get(ref, name); !compact(array).length && !(array as { root?: unknown })?.root && unset(ref, name); };