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

Doc: Need example of conditional schema using get as in userValidateConfig #126

Open
pgangwani opened this issue May 14, 2024 · 1 comment

Comments

@pgangwani
Copy link

Is your feature request related to a problem? Please describe.
I am looking for the example for the below overloaded function to get schema dynamically based on some diff atom.
Screenshot 2024-05-14 at 8 17 08 AM
I checked many test files and stories, didnt find anywhere. When I tried myself as

stringField({
schema : (s, get) => z.min(6).pipe(z.literal(get(someAtom).value))
});

Need to know if I am doing something wrong as I see some typescript errors.
Describe the solution you'd like
Need example of conditional schema along with optional callback based on diff atom.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

@pgangwani
Copy link
Author

There is type error when using schema function with 2 arguments.

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