uploadthing
uploadthing copied to clipboard
chore: react hook form example
⚠️ No Changeset found
Latest commit: ca8d0c5472811d7668d18c3b4ceeb9fd2e17d2ff
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
This PR includes no changesets
When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
docs-uploadthing | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Oct 7, 2023 8:00pm |
@markflorkowski would you like that more advanced use case within this example or in separate one?
Hmm, I think it can be in this one, since they are both rhf. Do you think that would be confusing?
@markflorkowski Hm, I've just been thinking. Maybe it's better to simply improve current example? I mean does it make sense to upload the image each time it is dropped? What might be the reason for that? Browser preview does not require it. If form data needs an URL of the image, it can be received during form submission. Simply upload image inside of onSubmit
and get URL from the response. Let me know, if I'm missing something here
The only reason I was thinking was it is slightly better UX in the form to have files upload in the background as you continue to fill out the form, instead of waiting for files to upload when submitting.
In the contrived example of a form that only contains a file upload it makes less sense, but I feel like in most cases it will be one field of many on a form.
Regardless, the url should be submitted with the form data, as presumably that data will be stored or used in some way by the application
Due to the likelihood of this code being outdated, I'm gonna close and rewrite this example in near future. Sorry for delays on it 🙃
@t3dotgg looking forward to it.