-
Notifications
You must be signed in to change notification settings - Fork 108
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
chore: add json example #686
base: main
Are you sure you want to change the base?
chore: add json example #686
Conversation
|
Just pushed a commit to your PR. There is no JSON field in Conform. Conform only understand string or File in an input. You will need to serialize it manually and make sure it to be serialized again when you access and update the field value (e.g. It might be worth adding an option to the |
@edmundhung is there anyway to use the jsonSchema type I had? for my use case I want to allow someone to add any JSON data because we're mapping it back to a users DB so we don't know the shape of the data. |
I have tested it once with your original type and it seems to recursively looping over and over again and crash. I am not sure why. It might be either a bug on the |
@edmundhung yep the jsonSchema type is in the GitHub docs of zod and works as expected https://github.com/colinhacks/zod?tab=readme-ov-file#json-type |
@lifeiscontent I have pushed up a fix to your branch. Let me know if this is what you were looking for. |
@edmundhung is there a way I can try a prerelease version of this quickly? I can try it in the project I'm working in and get back to you. |
1ead944
to
3c043ee
Compare
commit: @conform-to/dom
@conform-to/react
@conform-to/validitystate
@conform-to/yup
@conform-to/zod
|
Here you go ☝🏼 |
@edmundhung it works perfectly! :) |
@edmundhung any chance the work you did here could get merged? |
@edmundhung can you explain to me how I might be able to get a JSON field working with conform? I've setup this example, but the
.defaultValue
of the input renders as a blank input value