Struggling to make use of `Updater<T>`
So, I'm trying to replicate React Final Form's
parse
and format
properties, but I've hit a snag with Updater<T>
. Trying to type-narrow handleChange
's callback param so I can apply a parse function to it, gives me the following error
I'm probably going about this all wrong, so if there's a much simpler built-in way of doing this that I haven't figured out yet, I'd appreciate the help 😅
For reference
1 Reply
modern-tealOP•13mo ago
A solution that I've decided to settle with in the meantime, is to manually cast
v
to UpdaterFn
, but I'd rather have a solution that didn't use casting. I'd rather not lose type if I can help it.