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

form.value should used combined type #773

Open
lifeiscontent opened this issue Sep 16, 2024 · 0 comments
Open

form.value should used combined type #773

lifeiscontent opened this issue Sep 16, 2024 · 0 comments

Comments

@lifeiscontent
Copy link
Contributor

lifeiscontent commented Sep 16, 2024

Describe the bug and the expected behavior

I want to be able to reach into the form.value but it says I can't because its a union type, it'd be nice if I didn't have to type check the intent everywhere.

Conform version

latest

Steps to Reproduce the Bug or Issue

  1. create a schema with a discriminated union
  2. try to access the individual properties in typescript and watch it complain

What browsers are you seeing the problem on?

No response

Screenshots or Videos

No response

Additional context

I'm not sure if you already have types like this in conform, but here's a starting point if not:

https://www.typescriptlang.org/play/?#code/C4TwDgpgBAwg9gWwXAdgaQiAzgHgCoB8UAvFANaZwBmUeA3AFCiRQCCANuxtvkaXlAgAPYBBQATLFACGKEFAD85SjQEAuKCggA3CACdGzaAGUArgCNge6QGNgOVgBpYfNoJFjJsRZp36oGqyG4NAAcqjwSKjcuIQkUGaW1nYOnDG8zpHI6JixBASMTCFQAAoAljZkeCH4zmjuohJSHFy5vK4Cwo1eAN5QANpkUGUoUGgAugoasvIAvgxQPnj9EwsBUKYSEFQjEOKFRqUVVSEA8lS1Yw2eUlhWIwDmUAA+mqYI5v6vWCAfcOyuepdG5sNJtQhrJTlSrVSCXNAENYaLS6AwMIosACy+geEF48R6a0Gw1GWWi4II4w00JOkHOlzIBQYsygADIoITFsSRlBwigyTkeIRJtTjrCIPS8M5GYxZgdigAxOBweLYvS4nB9aQaKymaAs159cw6vR6uhQGwaPriE16qAs2ZMgD0TsWUAAegoGEA

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

No branches or pull requests

1 participant