uploadthing icon indicating copy to clipboard operation
uploadthing copied to clipboard

chore: react hook form example

Open Mr0Bread opened this issue 1 year ago • 6 comments

Mr0Bread avatar Oct 07 '23 12:10 Mr0Bread

⚠️ 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

changeset-bot[bot] avatar Oct 07 '23 12:10 changeset-bot[bot]

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

vercel[bot] avatar Oct 07 '23 12:10 vercel[bot]

@markflorkowski would you like that more advanced use case within this example or in separate one?

Mr0Bread avatar Oct 10 '23 16:10 Mr0Bread

Hmm, I think it can be in this one, since they are both rhf. Do you think that would be confusing?

markflorkowski avatar Oct 10 '23 16:10 markflorkowski

@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

Mr0Bread avatar Oct 11 '23 06:10 Mr0Bread

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

markflorkowski avatar Oct 11 '23 17:10 markflorkowski

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 avatar Sep 06 '24 05:09 t3dotgg

@t3dotgg looking forward to it.

DevTGhosh avatar Sep 17 '24 08:09 DevTGhosh