Closed juliusmarminge closed 2 months ago
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 | May 12, 2024 7:48pm |
Latest commit: 0c235659a1dcee051bc597104ca6e2c6a6636481
The changes in this PR will be included in the next version bump.
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
This adds an example using steventey/novel.
For convenience, it adds some additional dx helpers exported from
uploadthing/client
:generateReactHelpers.getRouteConfig(endpoint: keyof Router): ExpandedRouteConfig
: helper to extract the route config outside of react contextisValidFileSize(file: File, config: ExpandedRouteConfig): boolean
: validate a file is within the accepted rangeisValidFileType(file: File, config: ExpandedRouteConfig): boolean
: validate a file has an accepted typeExample Usage:
https://github.com/pingdotgg/uploadthing/blob/0ad4378d38a686615840dc1136d25b7f6ddaef08/examples/with-novel/uploadthing/novel-plugin.ts#L50-L61
Demo
https://github.com/pingdotgg/uploadthing/assets/51714798/524a4f4d-16ac-45b8-b17f-269dee549591