Closed daniel-rodrigue closed 9 months ago
Valid point,
though I'd left them internal because it's a bit of mix and match between the sync and async and then there's derived types from that that'd also need to be exported and anyone writing a utility would have a hard time knowing about each derivation.
That though is a side-effect of the concept of building atop atoms, so I guess most solutions would also involve the derivation.
I'll export them out, one sec
A bump to the latest should ease it for you :) https://github.com/jotaijs/jotai-form/releases/tag/v0.1.4
Woah! You are so fast! This is awesome. Thank you.
The
SyncState
,AsyncState
and likely others exports fromatomWithFormControls
andvalidateAtoms
are not re-exported in default index.As a consequence, if I want to declare an helper type for a string atom in my code, like:
export type StringAtom = WritableAtom<SyncState<string>, [SetStateAction<string>], void>;
for something like the following to hold 2 atoms:
I need to import
SyncState
directly from there:import { SyncState } from "jotai-form/dist/src/atomWithValidate"; // not great since this could change one day
instead of:
import { atomWithValidate, SyncState } from "jotai-form";