Published version of types lacking pristine/isPristine?
joshuaaron opened this issue · 2 comments
Not sure if it's an error on my end, but have updated to 0.12.1.
The published index.d.ts
inside react-use-form-state/dist
doesn't have the pristine or isPristine properties on the formState object:
// Type definitions for react-use-form-state 0.12.1
// ...
interface FormState<T, E = StateErrors<T, string>> {
values: StateValues<T>;
validity: StateValidity<T>;
touched: StateValidity<T>;
errors: E;
reset(): void;
clear(): void;
setField<K extends keyof T>(name: K, value: T[K]): void;
setFieldError(name: keyof T, error: string): void;
clearField(name: keyof T): void;
resetField(name: keyof T): void;
}
Would you be able to assist? I saw that they're added on the src/index.d.ts inside the repo however.
Hi @joshuaaron
The pristine functionality isn't quite ready for release yet (but it should be very soon). I have to admit that I was planning on a new release long time ago, but life got busy!
Thanks for the nudge though. I'll try to get back to this very soon, so stay tuned!
The master branch doesn't always reflect the latest release. The latest release is 0.12.1: https://github.com/wsmd/react-use-form-state/tree/0.12.1 (this link shows the proper documentation). Sorry for the confusion.
@wsmd No worries.
Very much looking forward to it being released, it will simplify a bunch of our form validation.
Thanks for the work.