This might be very specific and tricky but struggling to find a solution here.
Essentially we (the project I'm on) have wrappers around some of our Form controls to keep all the handler/setup boilerplate and I'm having trouble with the Select component that wraps the Select from the react-select library.
react-use-form-state exposes the 'raw' type to work with custom controls where you update the value yourself with the exposed setField method. This library also allows a custom type declaration to define your forms state:
const [ formState, { raw } ] = useFormState<FormSchema>()
To use this raw type in the custom component, the Input type behind this is generic where the type is the of your form state.
However, if I remove this extra level of abstraction and use it directly in the same function that instantiates the state with the type it works fine:
What I'm asking I guess is how would I type this correctly in the CustomSelect component to satisfy typescript correctly.