jotaijs / jotai-form

Form atoms for Jotai
MIT License
135 stars 1 forks source link

Types for `fieldErrors`, also maybe merge `fieldErrors` to root form `error` #28

Closed barelyhuman closed 6 months ago

barelyhuman commented 7 months ago

Types for the fieldErrors in atomWithFormControls is missing types.

The fieldErrors and error split was made to be an easy way to differentiate but it seems like it's easy to forget that there's a fieldError concept even when there's types.

Might want to change the API to have the below instead.

const { form, fields } = errors