Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Manual Type Creation #4

Open
Tbhesswebber opened this issue Nov 21, 2023 · 1 comment · May be fixed by #5
Open

Manual Type Creation #4

Tbhesswebber opened this issue Nov 21, 2023 · 1 comment · May be fixed by #5

Comments

@Tbhesswebber
Copy link

Typegen isn't working (particularly in a Code Sandbox where it wasn't worth setting it up), but I can't quite figure out the way that I should be constructing the type for my logic. I dug through types.ts to see if there was something along the lines of MakeFormLogicType<TInputs, TValues, TActions, TProps> = MakeLogicType<FormValues<TInputs> & TValues, FormActions<TInputs> & TActions, TProps>. There's nothing that I've seen in any documentation and the types file doesn't have anything that obviously attempts to solve this problem - is there a recommended path forward here?

@mariusandra
Copy link
Member

Such FormActions<> and FormValues<> types seem like the right approach, but sadly they don't exist 😅

With modern TS template literal types and support for things like Capitalize<T>, I believe such types are very doable. You can probably generate all the required values and actions this way from just the form name and the default fields.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants